ralmn / OctoPrint-Ikea-tradfri

Control Ikea Tradfri outlet from Octoprint
https://plugins.octoprint.org/plugins/ikea_tradfri/
10 stars 4 forks source link

Can't install via PluginManager #34

Closed crysxd closed 3 years ago

crysxd commented 3 years ago

Hi! I see you've been very busy! Thanks for improving this plugin!

Unfortunatly, I can't install the 1.5.3 version via the plugin manager. Logs attached.


Installing plugin "Ikea Tradfri" from https://github.com/ralmn/OctoPrint-Ikea-tradfri/archive/master.zip...
/usr/local/bin/python -m pip --disable-pip-version-check install file:///tmp/tmpsx5j8we2/OctoPrint-Ikea-tradfri-master.zip --no-cache-dir
Processing /tmp/tmpsx5j8we2/OctoPrint-Ikea-tradfri-master.zip
Requirement already satisfied: OctoPrint in /usr/local/lib/python3.8/site-packages (from OctoPrint-Ikea-Tradfri==1.5.3) (1.5.2)
Requirement already satisfied: sarge in /usr/local/lib/python3.8/site-packages (from OctoPrint-Ikea-Tradfri==1.5.3) (0.1.5.post0)
Collecting aiocoap[all]@ https://github.com/chrysn/aiocoap/archive/master.zip
Downloading https://github.com/chrysn/aiocoap/archive/master.zip
Collecting cbor2
Downloading cbor2-5.2.0.tar.gz (81 kB)
Collecting cryptography>=2.0
Downloading cryptography-3.3.1.tar.gz (539 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-i37rdogg/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.12; platform_python_implementation != '"'"'PyPy'"'"''
cwd: None
Complete output (102 lines):
Collecting cffi>=1.12
Using cached cffi-1.14.4.tar.gz (471 kB)
Collecting setuptools>=40.6.0
Using cached setuptools-51.1.2-py3-none-any.whl (784 kB)
Collecting wheel
Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting pycparser
Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
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: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-u327p01b
cwd: /tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/
Complete output (36 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.8
creating build/lib.linux-armv7l-3.8/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/model.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/error.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/__init__.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/api.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.8/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.8/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-3.8/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.8/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-3.8
creating build/temp.linux-armv7l-3.8/c
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.8/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 '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: pycparser, wheel, setuptools, 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: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/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-2bp7p5jz/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-i37rdogg/overlay --compile --install-headers /tmp/pip-build-env-i37rdogg/overlay/include/python3.8/cffi
cwd: /tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/
Complete output (36 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.8
creating build/lib.linux-armv7l-3.8/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/model.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/error.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/__init__.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/api.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-3.8/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.8/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.8/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-3.8/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.8/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-3.8
creating build/temp.linux-armv7l-3.8/c
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.8/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 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oncenjw5/cffi_aa31ca566d7844ada7c00d5c47cc2856/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-2bp7p5jz/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-i37rdogg/overlay --compile --install-headers /tmp/pip-build-env-i37rdogg/overlay/include/python3.8/cffi Check the logs for full command output.
WARNING: You are using pip version 20.3.1; however, version 20.3.3 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-i37rdogg/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.12; platform_python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.
Error!
Could not parse output from pip, see plugin_pluginmanager_console.log for generated output
crysxd commented 3 years ago

In fact, 1.4.4 is the last version that can be instlalled, tested all 1.5.x versions :) Let me know if I can help!

crysxd commented 3 years ago

Ok, found the issue! I use OctoPrint in a docker container (the official image) and there following dependencies are missing: libffi-dev and libssl-dev

This means that currently the plugin is not compatible with the docker versions of OctoPrint. I'm not sure if this is something you can fix on your side by including these dependencies somehow.

If somebody has the same issue, this Dockerfile solves the issue:

FROM octoprint/octoprint:1.5.2
RUN apt-get update && apt-get install -y libffi-dev libssl-dev

Besides this....the setup of the plugin was now smooth as butter! Big progress!