|
本帖最后由 赫山老妖 于 2020-3-18 23:20 编辑
ubuntu16.04升级python到3.6安装homeassistant异常
因ubuntu16.04自带的python3.5.2,不符合ha安装的python3.5.3的要求
自行修改安装好python3.6
按大佬的无坑版安装教程
(20180630更新)Ubuntu安装HomeAssistant教程(ubuntu17.10无坑版)
(ha_venv) homeassistant@NanoPi-NEO-Core:/srv/homeassistant$ pip3 install homeassistant
Collecting homeassistant
Using cached homeassistant-0.103.6-py3-none-any.whl (6.0 MB)
Collecting contextvars==2.4; python_version < "3.7"
Using cached contextvars-2.4.tar.gz (9.6 kB)
Collecting python-slugify==4.0.0
Using cached python-slugify-4.0.0.tar.gz (8.8 kB)
Collecting pyyaml==5.1.2
Using cached PyYAML-5.1.2.tar.gz (265 kB)
Collecting attrs==19.3.0
Using cached attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Requirement already satisfied: certifi>=2019.9.11 in ./ha_venv/lib/python3.6/site-packages (from homeassistant) (2019.11.28)
Collecting importlib-metadata==0.23
Using cached importlib_metadata-0.23-py2.py3-none-any.whl (28 kB)
Collecting jinja2>=2.10.3
Using cached Jinja2-2.11.1-py2.py3-none-any.whl (126 kB)
Collecting cryptography==2.8
Using cached cryptography-2.8.tar.gz (504 kB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /srv/homeassistant/ha_venv/bin/python3 /srv/homeassistant/ha_venv/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-__tt9obx/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; platform_python_implementation != '"'"'PyPy'"'"''
cwd: None
Complete output (51 lines):
Collecting setuptools>=40.6.0
Using cached setuptools-46.0.0-py3-none-any.whl (582 kB)
Collecting wheel
Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Collecting cffi!=1.11.3,>=1.8
Using cached cffi-1.14.0.tar.gz (463 kB)
Collecting pycparser
Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Installing collected packages: setuptools, wheel, pycparser, 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: /srv/homeassistant/ha_venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8kvvhfi7/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8kvvhfi7/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-record-orwyu7h7/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-__tt9obx/overlay --compile --install-headers /srv/homeassistant/ha_venv/include/site/python3.6/cffi
cwd: /tmp/pip-install-8kvvhfi7/cffi/
Complete output (34 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.6
creating build/lib.linux-armv7l-3.6/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/model.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/error.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/api.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/__init__.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-3.6/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.6/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.6/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-3.6/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.6/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-3.6
creating build/temp.linux-armv7l-3.6/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/srv/homeassistant/ha_venv/include -I/usr/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.6/c/_cffi_backend.o
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /srv/homeassistant/ha_venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8kvvhfi7/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8kvvhfi7/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-record-orwyu7h7/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-__tt9obx/overlay --compile --install-headers /srv/homeassistant/ha_venv/include/site/python3.6/cffi Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: /srv/homeassistant/ha_venv/bin/python3 /srv/homeassistant/ha_venv/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-__tt9obx/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; platform_python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.
(ha_venv) homeassistant@NanoPi-NEO-Core:/srv/homeassistant$
请各位大神不吝指点迷津,折腾好几天了呵。
补充说明下:
在系统下环境下 sudo apt-get install python3-cffi 正常
在虚拟环境下,pip3 install --upgrade setuptools==40.6.0 或 pip3 install --upgrade setuptools 均安装正常
在虚拟环境下,pip3 install --upgrade cffi或指定版本,无法通过。不知道问题在哪呵。
|
|