Skip to content

No module named 'uplink' #17

@Alkahna

Description

@Alkahna

after installing I get the following error when trying to run it:
Traceback (most recent call last): File "example.py", line 6, in <module> from thinq2.controller.auth import ThinQAuth File "/etc/openhab/scripts/thinq2-python/thinq2/controller/auth.py", line 9, in <module> from uplink.clients.io import RequestTemplate, transitions ModuleNotFoundError: No module named 'uplink'

when running poetry install in found this eror message:

`Installing cffi (1.14.5): Failed

EnvCommandError

Command ['/home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/bin/pip', 'install', '--no-deps', '/home/lukaz/.cache/pypoetry/artifacts/83/1b/72/38f5684c129d97cae47042e3bbb688afed3aee9c204d6f6e5afce1df95/cffi-1.14.5.tar.gz'] errored with the following return code 1, and output:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/lukaz/.cache/pypoetry/artifacts/83/1b/72/38f5684c129d97cae47042e3bbb688afed3aee9c204d6f6e5afce1df95/cffi-1.14.5.tar.gz
Building wheels for collected packages: cffi
Building wheel for cffi (setup.py): started
Building wheel for cffi (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-27c1pkgi/setup.py'"'"'; file='"'"'/tmp/pip-req-build-27c1pkgi/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'"'"'))' bdist_wheel -d /tmp/pip-wheel-rnj8edqt
cwd: /tmp/pip-req-build-27c1pkgi/
Complete output (56 lines):
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 running bdist_wheel running build running build_py creating build creating build/lib.linux-armv7l-3.7 creating build/lib.linux-armv7l-3.7/cffi copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/__init__.py -> build/lib.linux-armv7l-3.7/cffi copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi running build_ext building '_cffi_backend' extension creating build/temp.linux-armv7l-3.7 creating build/temp.linux-armv7l-3.7/c 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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/include -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory #include <ffi.h> ^~~~~~~ compilation terminated. error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1 ---------------------------------------- ERROR: Failed building wheel for cffi Running setup.py clean for cffi Failed to build cffi Installing collected packages: cffi Running setup.py install for cffi: started Running setup.py install for cffi: finished with status 'error' ERROR: Command errored out with exit status 1: command: /home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-27c1pkgi/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-27c1pkgi/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 /tmp/pip-record-nd1bak4z/install-record.txt --single-version-externally-managed --compile --install-headers /home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/include/site/python3.7/cffi cwd: /tmp/pip-req-build-27c1pkgi/ Complete output (56 lines): 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
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.7
creating build/lib.linux-armv7l-3.7/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/init.py -> build/lib.linux-armv7l-3.7/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-3.7
creating build/temp.linux-armv7l-3.7/c
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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/include -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-27c1pkgi/setup.py'"'"'; file='"'"'/tmp/pip-req-build-27c1pkgi/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 /tmp/pip-record-nd1bak4z/install-record.txt --single-version-externally-managed --compile --install-headers /home/lukaz/.cache/pypoetry/virtualenvs/thinq2-rt_iq-AX-py3.7/include/site/python3.7/cffi Check the logs for full command output.

at ~/.poetry/lib/poetry/utils/env.py:1075 in run
1071│ output = subprocess.check_output(
1072│ cmd, stderr=subprocess.STDOUT, **kwargs
1073│ )
1074│ except CalledProcessError as e:
→ 1075│ raise EnvCommandError(e, input=input
)
1076│
1077│ return decode(output)
1078│
1079│ def execute(self, bin, *args, **kwargs):`

but I did install cffi afterwards using pip3 install cffi and it installs fine with no errors. But that did not fix it.
Someone already had the same issue and found a solution but didn't post it....

Any idea why my install will not run??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions