poljar / weechat-matrix

Weechat Matrix protocol script written in python
Other
964 stars 122 forks source link

python-olm install fails #296

Open poetaman opened 3 years ago

poetaman commented 3 years ago

>>pip3 install -r requirements.txt

Installing collected packages: python-olm, peewee, matrix-nio, cryptography, cachetools, atomicwrites, webcolors, python-magic, pyOpenSSL
    Running setup.py install for python-olm ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/pip-install-0lk9mzqn/python-olm_70b88b0c977a4e64a85edae91267037d/setup.py'"'"'; __file__='"'"'/private/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/pip-install-0lk9mzqn/python-olm_70b88b0c977a4e64a85edae91267037d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/pip-record-c6y3cq0z/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/python-olm
         cwd: /private/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/pip-install-0lk9mzqn/python-olm_70b88b0c977a4e64a85edae91267037d/
    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.macosx-10.9-universal2-3.9
    creating build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/sas.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/_finalize.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/utility.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/session.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/__init__.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/__version__.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/group_session.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/pk.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/_compat.py -> build/lib.macosx-10.9-universal2-3.9/olm
    copying olm/account.py -> build/lib.macosx-10.9-universal2-3.9/olm
    running build_ext
    generating cffi module 'build/temp.macosx-10.9-universal2-3.9/_libolm.c'
    creating build/temp.macosx-10.9-universal2-3.9
    building '_libolm' extension
    creating build/temp.macosx-10.9-universal2-3.9/build
    creating build/temp.macosx-10.9-universal2-3.9/build/temp.macosx-10.9-universal2-3.9
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/opt/homebrew/opt/icu4c/include -I/opt/homebrew/opt/llvm/include -I/opt/homebrew/Cellar/lua@5.1/5.1.5_8/include -I/opt/homebrew/Cellar/ncurses/6.2/include -I/opt/homebrew/Cellar/ncurses/6.2/include/ncursesw -I/opt/homebrew/Cellar/libxlsxwriter/1.0.0/include -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.2/include/gdk-pixbuf-2.0 -I/opt/homebrew/Cellar/bdw-gc/8.0.4_2/include -I/opt/homebrew/Cellar/notmuch/0.31.3_1/include -I/opt/homebrew/opt/zlib/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c build/temp.macosx-10.9-universal2-3.9/_libolm.c -o build/temp.macosx-10.9-universal2-3.9/build/temp.macosx-10.9-universal2-3.9/_libolm.o -I../include
    build/temp.macosx-10.9-universal2-3.9/_libolm.c:570:18: fatal error: 'olm/olm.h' file not found
            #include <olm/olm.h>
                     ^~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/pip-install-0lk9mzqn/python-olm_70b88b0c977a4e64a85edae91267037d/setup.py'"'"'; __file__='"'"'/private/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/pip-install-0lk9mzqn/python-olm_70b88b0c977a4e64a85edae91267037d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/40/g1hxt47j5sn3wg34689bfpnr0000gn/T/pip-record-c6y3cq0z/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/python-olm Check the logs for full command output.
jandrusk commented 3 years ago

I receive the same error on Ubuntu 21.04 64-bit.

poljar commented 3 years ago

There are now binary releases of python-olm, which can be in the upstream gitlab repo: https://gitlab.matrix.org/matrix-org/olm/-/packages/28.

poetaman commented 3 years ago

@poljar Does that help macOS ARM64 (i.e aarch64)?

poljar commented 3 years ago

No, seems like only Linux builds are available.

poljar commented 3 years ago

So the issue here seems to be that the libolm fails to install a header if the Makefile build is used.

Upstream issue: https://gitlab.matrix.org/matrix-org/olm/-/issues/8.

Amar1729 commented 2 years ago

@poljar Does that help macOS ARM64 (i.e aarch64)?

See comment for export statements you need to make pip see homebrew-installed files https://github.com/poljar/weechat-matrix/issues/321#issuecomment-1086143663