poljar / weechat-matrix

Weechat Matrix protocol script written in python
Other
962 stars 121 forks source link

Can't install requirements.txt on Debian #258

Closed ghost closed 3 years ago

ghost commented 3 years ago

This issue seems to be exclusive to Debian for me, since everything works fine on fedora. What happens is this:

Ignoring typing: markers 'python_version < "3.5"' don't match your environment
Ignoring future: markers 'python_version < "3.2"' don't match your environment
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pyOpenSSL (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/b2/5e/06351ede29fd4899782ad335c2e02f1f862a887c20a3541f17c3fa1a3525/pyOpenSSL-20.0.1-py2.py3-none-any.whl
Collecting webcolors (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/12/05/3350559de9714b202e443a9e6312937341bd5f79f4e4f625744295e7dd17/webcolors-1.11.1-py3-none-any.whl
Collecting atomicwrites (from -r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/2c/a0/da5f49008ec6e9a658dbf5d7310a4debd397bce0b4db03cf8a410066bb87/atomicwrites-1.4.0-py2.py3-none-any.whl
Collecting attrs (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/c3/aa/cb45262569fcc047bf070b5de61813724d6726db83259222cd7b4c79821a/attrs-20.3.0-py2.py3-none-any.whl
Collecting logbook (from -r requirements.txt (line 7))
  Using cached https://www.piwheels.org/simple/logbook/Logbook-1.5.3-cp37-cp37m-linux_armv7l.whl
Collecting pygments (from -r requirements.txt (line 8))
  Using cached https://files.pythonhosted.org/packages/17/e3/c7ea888bd6e9849c60b1f378637850265177ed01297137f544a7ecf7d7ba/Pygments-2.7.4-py3-none-any.whl
Collecting matrix-nio[e2e]>=0.6 (from -r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/88/4a/fa02a862b0806462c60b6a776d5ee6429a0b16b78a71e63912d2e3aeec78/matrix_nio-0.16.0-py3-none-any.whl
Collecting aiohttp (from -r requirements.txt (line 10))
  Using cached https://www.piwheels.org/simple/aiohttp/aiohttp-3.7.3-cp37-cp37m-linux_armv7l.whl
Collecting python-magic (from -r requirements.txt (line 11))
  Using cached https://files.pythonhosted.org/packages/77/69/3b0f03037d91e591a8f2bca699b4b7bf85609a23e4b081df585fbce1c180/python_magic-0.4.20-py2.py3-none-any.whl
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from -r requirements.txt (line 12)) (2.21.0)
Requirement already satisfied: six>=1.5.2 in /usr/lib/python3/dist-packages (from pyOpenSSL->-r requirements.txt (line 1)) (1.12.0)
Collecting cryptography>=3.2 (from pyOpenSSL->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/27/5a/007acee0243186123a55423d49cbb5c15cb02d76dd1b6a27659a894b13a2/cryptography-3.4.4.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
Collecting future<0.19.0,>=0.18.2 (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://www.piwheels.org/simple/future/future-0.18.2-py3-none-any.whl
Collecting pycryptodome<4.0.0,>=3.9.7 (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://www.piwheels.org/simple/pycryptodome/pycryptodome-3.10.1-cp35-abi3-linux_armv7l.whl
Collecting jsonschema<4.0.0,>=3.2.0 (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl
Collecting unpaddedbase64<2.0.0,>=1.1.0 (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/96/da/2ebf30d2fdf0f4dc949b4935e408aaa9cca948963e55ea3c99730b1f74c0/unpaddedbase64-1.1.0-py2.py3-none-any.whl
Collecting h11<0.10.0,>=0.9.0 (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/5a/fd/3dad730b0f95e78aeeb742f96fa7bbecbdd56a58e405d3da440d5bfb90c6/h11-0.9.0-py2.py3-none-any.whl
Collecting aiofiles<0.5.0,>=0.4.0 (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/cf/f2/a67a23bc0bb61d88f82aa7fb84a2fb5f278becfbdc038c5cbb36c31feaf1/aiofiles-0.4.0-py3-none-any.whl
Collecting h2<4.0.0,>=3.2.0 (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/25/de/da019bcc539eeab02f6d45836f23858ac467f584bfec7a526ef200242afe/h2-3.2.0-py2.py3-none-any.whl
Collecting peewee<4.0.0,>=3.13.2; extra == "e2e" (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://www.piwheels.org/simple/peewee/peewee-3.14.1-py3-none-any.whl
Collecting cachetools<5.0.0,>=4.0.0; extra == "e2e" (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/bb/72/8df2e0dc991f1a1d2c6869404e7622e8ee50d80bff357dbb57c3df70305b/cachetools-4.2.1-py3-none-any.whl
Collecting python-olm<4.0.0,>=3.1.3; extra == "e2e" (from matrix-nio[e2e]>=0.6->-r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/d4/a4/1face47e65118d7c52726dfa305410a96bc4a0c6f3f99c90bc7104aebf21/python-olm-3.1.3.tar.gz
    Complete output from command python setup.py egg_info:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
              ^~~~~~~
    compilation terminated.
    Traceback (most recent call last):
      File "/usr/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
        extra_postargs)
      File "/usr/lib/python3.7/distutils/ccompiler.py", line 909, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/lib/python3.7/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
        % (cmd, exit_status))
    distutils.errors.DistutilsExecError: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 172, in run
        cmd = self.call_command('install_lib', warn_dir=0)
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 158, in call_command
        self.run_command(cmdname)
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 24, in run
        self.build()
      File "/usr/lib/python3.7/distutils/command/install_lib.py", line 109, in build
        self.run_command('build_ext')
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 78, in run
        _build_ext.run(self)
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
        depends=ext.depends)
      File "/usr/lib/python3.7/distutils/ccompiler.py", line 574, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/usr/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-x5ih1as5/cffi-1.14.5/setup.py", line 238, in <module>
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.7/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1169, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/lib/python3/dist-packages/setuptools/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-x5ih1as5/cffi-1.14.5/setup.py", line 238, in <module>
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.7/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-lpee6ux0/python-olm/setup.py", line 30, in <module>
        zip_safe=False
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 724, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 791, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 704, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 730, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 915, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1183, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1171, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-s6y7srro/python-olm/              
ghost commented 3 years ago

I have the libolm-dev package installed, too.

ghost commented 3 years ago

Nevermind I think I can debug this.

ghost commented 3 years ago

Ok, I'm still stuck. Here's my problem:

    Running setup.py install for python-olm ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jb85v7c8/python-olm_63eab5ae76d34a7da59f99c105165437/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jb85v7c8/python-olm_63eab5ae76d34a7da59f99c105165437/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wlfvvfbf/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/lcoogan/.local/include/python3.7m/python-olm
         cwd: /tmp/pip-install-jb85v7c8/python-olm_63eab5ae76d34a7da59f99c105165437/
    Complete output (29 lines):
    make: *** No rule to make target '../include/olm/olm.h', needed by 'include/olm/olm.h'.  Stop.
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.7
    creating build/lib.linux-armv7l-3.7/olm
    copying olm/account.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/__version__.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/utility.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/sas.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/group_session.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/session.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/_compat.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/_finalize.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/__init__.py -> build/lib.linux-armv7l-3.7/olm
    copying olm/pk.py -> build/lib.linux-armv7l-3.7/olm
    running build_ext
    generating cffi module 'build/temp.linux-armv7l-3.7/_libolm.c'
    creating build/temp.linux-armv7l-3.7
    building '_libolm' extension
    creating build/temp.linux-armv7l-3.7/build
    creating build/temp.linux-armv7l-3.7/build/temp.linux-armv7l-3.7
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c build/temp.linux-armv7l-3.7/_libolm.c -o build/temp.linux-armv7l-3.7/build/temp.linux-armv7l-3.7/_libolm.o -I../include
    build/temp.linux-armv7l-3.7/_libolm.c:573:18: fatal error: olm/pk.h: No such file or directory
             #include <olm/pk.h>
                      ^~~~~~~~~~
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jb85v7c8/python-olm_63eab5ae76d34a7da59f99c105165437/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jb85v7c8/python-olm_63eab5ae76d34a7da59f99c105165437/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wlfvvfbf/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/lcoogan/.local/include/python3.7m/python-olm Check the logs for full command output.

I have /usr/include/libolm though.

ghost commented 3 years ago

Figured it out with the help of user.

Schmools commented 3 years ago

I'm running into a similar issue. How did you fix this?

ghost commented 3 years ago

I'm running into a similar issue. How did you fix this?

I thought I fixed it. You should look at this. I haven't had the chance to try it myself since I messed up my apt sources and I'm trying to get that under control.

aenygma commented 3 years ago

I ran into this same/similar problem on Ubuntu after installing the libolm-dev from their repos. I resolved it by using Matrix's OLM (https://gitlab.matrix.org/matrix-org/olm), building and installing (including the libs).

cmake . -Bbuild
cmake --build build  
make test
make install

Also needed to add the installed lib path to LD_LIBRARY_PATH, so weechat could access it. (Though this maybe os/distro specific) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib