Closed mreassassin closed 5 years ago
apt install libffi-dev
And you wanna use Python 3.5 or higher.. as the README states
Is the issue solved?
not really... I tried 'apt install libffi-dev' which seemed to install (saw progress bars and such) but when I tried to run one of the scripts it would not work. my workaround has been to create a virtual environment (found this from the homeassistant plugin page) and activate it before running the scripts (which I have some being called from homebridge via cmdswitch2).
I didn't used to have to activate the virtual environment before... how do I make it so I don't need to activate a virtual environment?
Depends on your used python virtual environment system https://www.google.com/search?q=python+virtual+environment+automatically+activate
i recently did a fresh install of raspbian to get rid of a bunch of permissions problems I was having. I got everything back up and running EXCEPT being able to turn my xbox off using homebridge and/or homeassistant. each time I try to install smartglass-core-python I get errors. I can't remember how I got it to work last time around? here's my log:
Failed building wheel for cryptography Running setup.py clean for cryptography Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" clean --all: 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 containinglibffi.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:17: fatal error: ffi.h: No such file or directoryinclude
compilation terminated. Traceback (most recent call last): File "", line 1, in
File "/tmp/pip-build-sE3Q5U/cryptography/setup.py", line 318, in
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 317, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 372, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1118, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1130, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 440, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 699, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 725, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 906, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1145, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1133, 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
Failed cleaning build dir for cryptography Running setup.py bdist_wheel for cffi ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cffi/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/tmpAyNrVOpip-wheel- --python-tag cp27: 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 containinglibffi.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-2.7 creating build/lib.linux-armv7l-2.7/cffi copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/init.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi running build_ext building '_cffi_backend' extension creating build/temp.linux-armv7l-2.7 creating build/temp.linux-armv7l-2.7/c arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directoryinclude
compilation terminated. error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Failed building wheel for cffi Running setup.py clean for cffi Failed to build cryptography cffi Installing collected packages: urwid, urllib3, idna, chardet, certifi, requests, demjson, appdirs, xbox-webapi, construct, aenum, pycparser, cffi, greenlet, gevent, dpkt, asn1crypto, six, enum34, ipaddress, cryptography, xbox-smartglass-core Running setup.py install for cffi ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cffi/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-xJqYGp-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: 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 containinglibffi.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-2.7 creating build/lib.linux-armv7l-2.7/cffi copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/init.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi running build_ext building '_cffi_backend' extension creating build/temp.linux-armv7l-2.7 creating build/temp.linux-armv7l-2.7/c arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directoryinclude
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cffi/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-xJqYGp-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-sE3Q5U/cffi/
it may be worth noting that I originally tried this with home assistant than figured a way to use the python scripts to work with homebridge using cmdswitch2. maybe I need to re-install the home assistant plugin to allow this to install properly?