anibali / pywebp

Python bindings for WebP
MIT License
73 stars 25 forks source link

Installation fails on Arch Linux (libwebp/1.0.3@bincrafters/stable) #21

Closed Martmists-GH closed 3 years ago

Martmists-GH commented 3 years ago

Python: tried 3.8.6, 3.9.0 and 3.9.0rc2 Libwebp: 1.1.0-1 from Arch Linux "extra" repositories

$ gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC) 
$ pip install webp

Collecting webp
  Using cached webp-0.1.0.tar.gz (10 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/mart/.pyenv/versions/3.9.0rc2/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s_tsffs8/webp/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s_tsffs8/webp/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-bhtb9v4m
         cwd: /tmp/pip-install-s_tsffs8/webp/
    Complete output (71 lines):
    Configuration:
    [settings]
    arch=x86_64
    arch_build=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++
    compiler.version=10
    os=Linux
    os_build=Linux
    [options]
    [build_requires]
    [env]

    conanfile.txt: Installing package
    Requirements
        libwebp/1.0.3@bincrafters/stable from 'conan-center' - Cache
    Packages
        libwebp/1.0.3@bincrafters/stable:abc00ad0249e9242a1b4cfef4dc265e67c782e32 - Missing

    Installing (downloading, building) binaries...
    ERROR: Missing binary: libwebp/1.0.3@bincrafters/stable:abc00ad0249e9242a1b4cfef4dc265e67c782e32

    libwebp/1.0.3@bincrafters/stable: WARN: Can't find a 'libwebp/1.0.3@bincrafters/stable' package for the specified settings, options and dependencies:
    - Settings: arch=x86_64, build_type=Release, compiler=gcc, compiler.version=10, os=Linux
    - Options: fPIC=True, near_lossless=True, shared=False, swap_16bit_csp=False, with_simd=True
    - Dependencies:
    - Requirements:
    - Package ID: abc00ad0249e9242a1b4cfef4dc265e67c782e32

    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-install-s_tsffs8/webp/setup.py", line 6, in 
        setup(
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
        return distutils.core.setup(**attrs)
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/site-packages/setuptools/dist.py", line 429, in __init__
        _Distribution.__init__(self, {
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/site-packages/setuptools/dist.py", line 721, in finalize_options
        ep(self)
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/site-packages/setuptools/dist.py", line 728, in _finalize_setup_keywords
        ep.load()(self, ep.name, value)
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/home/mart/.pyenv/versions/3.9.0rc2/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "webp_build/builder.py", line 14, in 
        conan.install(path=getcwd(), cwd=tmp_dir)
      File "/tmp/pip-install-s_tsffs8/webp/.eggs/conan-1.32.0-py3.9.egg/conans/client/conan_api.py", line 94, in wrapper
        return f(api, *args, **kwargs)
      File "/tmp/pip-install-s_tsffs8/webp/.eggs/conan-1.32.0-py3.9.egg/conans/client/conan_api.py", line 598, in install
        deps_install(app=self.app,
      File "/tmp/pip-install-s_tsffs8/webp/.eggs/conan-1.32.0-py3.9.egg/conans/client/manager.py", line 77, in deps_install
        installer.install(deps_graph, remotes, build_modes, update, keep_build=keep_build,
      File "/tmp/pip-install-s_tsffs8/webp/.eggs/conan-1.32.0-py3.9.egg/conans/client/installer.py", line 305, in install
        self._build(nodes_by_level, keep_build, root_node, graph_info, remotes, build_mode, update)
      File "/tmp/pip-install-s_tsffs8/webp/.eggs/conan-1.32.0-py3.9.egg/conans/client/installer.py", line 413, in _build
        self._raise_missing(missing)
      File "/tmp/pip-install-s_tsffs8/webp/.eggs/conan-1.32.0-py3.9.egg/conans/client/installer.py", line 358, in _raise_missing
        raise ConanException(textwrap.dedent('''\
    conans.errors.ConanException: Missing prebuilt package for 'libwebp/1.0.3@bincrafters/stable'
    Try to build from sources with '--build=libwebp'
    Use 'conan search  --table table.html'
    Or read 'http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package'

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.1; however, version 20.3.1 is available.
You should consider upgrading via the '/home/mart/.pyenv/versions/3.9.0rc2/bin/python3.9 -m pip install --upgrade pip' command.
anibali commented 3 years ago

Known issue: https://github.com/anibali/pywebp/issues/15

Martmists-GH commented 3 years ago

Is there a way to install pywebp with the package manager version of libwebp for now?

anibali commented 3 years ago

Not currently. The reason why I chose not to use the system-installed version of webp is that that libwebp can be compiled with different feature sets enabled, and I wanted to be sure of the available functionality.

Martmists-GH commented 3 years ago

Are there any alternative python libraries you recommend for handling webp files?

anibali commented 3 years ago

Perhaps you could try Pillow, which apparently does have WebP support.

aviogit commented 3 years ago

I was having the same issue on a Bright Cluster node and I solved (brilliantly, let me tell you) with rsync <myvenv>/lib/python3.8/site-packages/*webp* user@node:<myothervenv>/lib/python3.6/site-packages.

Honestly, it's a little miracle that it worked.

(the *webp* pattern is necessary to copy the three webp* directories and _webp.abi3.so)