『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 3592|回复: 4

[已解决] HomeAssistant接入homkit提示环境不满足要求

[复制链接]

4

主题

63

帖子

204

积分

论坛积极会员

轮谈官吏员

积分
204
金钱
141
HASS币
0
QQ
发表于 2019-5-9 10:31:05 | 显示全部楼层 |阅读模式
本帖最后由 waylee 于 2019-5-9 12:05 编辑

官方教程:
https://www.home-assistant.io/components/homekit/
论坛教程:
https://bbs.hassbian.com/forum.p ... 7&highlight=homekit
不会英语,一句一句百度翻译,看完了,都没有解决.论坛淘宝店卖家说:找不对时间,试了一百次也弄不对的.

根据论坛的教程尝试了一遍不行,查看日志发现:
Setup failed for homekit: Could not install all requirements.
Not initializing homekit because could not install requirement HAP-python==2.5.0

Unable to install package HAP-python==2.5.0: ERROR: Complete output from command /usr/bin/python3.6 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-cxc9b4v5/ed25519/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-ktw3hypv/install-record.txt --single-version-externally-managed --prefix '' --compile --user --prefix=:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/test_ed25519.py -> build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/__init__.py -> build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/_version.py -> build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/keys.py -> build/lib.linux-x86_64-3.6/ed25519
    UPDATING build/lib.linux-x86_64-3.6/ed25519/_version.py
    set build/lib.linux-x86_64-3.6/ed25519/_version.py to '1.4'
    running build_ext
    building 'ed25519._ed25519' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/ed25519-glue
    creating build/temp.linux-x86_64-3.6/src/ed25519-supercop-ref
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Isrc/ed25519-supercop-ref -I/usr/include/python3.6m -c src/ed25519-glue/ed25519module.c -o build/temp.linux-x86_64-3.6/src/ed25519-glue/ed25519module.o
    src/ed25519-glue/ed25519module.c:17:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python3.6 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-cxc9b4v5/ed25519/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-ktw3hypv/install-record.txt --single-version-externally-managed --prefix '' --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-cxc9b4v5/ed25519/
连接中断。正在重新连接...




回复

使用道具 举报

4

主题

63

帖子

204

积分

论坛积极会员

轮谈官吏员

积分
204
金钱
141
HASS币
0
QQ
 楼主| 发表于 2019-5-9 10:41:33 | 显示全部楼层
本帖最后由 waylee 于 2019-5-9 10:44 编辑

运行 pip3.6 install HAP-python

Requirement already satisfied: ecdsa in /usr/local/lib/python3.6/site-packages (from tlslite-ng->HAP-python) (0.13.2)
Installing collected packages: ifaddr, zeroconf, ed25519, curve25519-donna, HAP-python
  Running setup.py install for ifaddr ... done
  Running setup.py install for ed25519 ... error
    ERROR: Complete output from command /usr/bin/python3.6 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-93fwe5pc/ed25519/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-1mgctrsm/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/test_ed25519.py -> build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/__init__.py -> build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/_version.py -> build/lib.linux-x86_64-3.6/ed25519
    copying src/ed25519/keys.py -> build/lib.linux-x86_64-3.6/ed25519
    UPDATING build/lib.linux-x86_64-3.6/ed25519/_version.py
    set build/lib.linux-x86_64-3.6/ed25519/_version.py to '1.4'
    running build_ext
    building 'ed25519._ed25519' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/ed25519-glue
    creating build/temp.linux-x86_64-3.6/src/ed25519-supercop-ref
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Isrc/ed25519-supercop-ref -I/usr/include/python3.6m -c src/ed25519-glue/ed25519module.c -o build/temp.linux-x86_64-3.6/src/ed25519-glue/ed25519module.o
    src/ed25519-glue/ed25519module.c:17:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python3.6 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-93fwe5pc/ed25519/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-1mgctrsm/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-93fwe5pc/ed25519/




安装组件
[root@WAYLEE .homeassistant]# pip3.6 install curve25519-donna
Looking in indexes: [url]http://mirrors.aliyun.com/pypi/simple/[/url]
Collecting curve25519-donna
  Downloading [url]http://mirrors.aliyun.com/pypi/packages/01/05/1ab1cc54c2b1e933721b8e65fedc01098e6b8ffdccedbc4a682d4e0db8c1/curve25519-donna-1.3.tar.gz[/url]
Installing collected packages: curve25519-donna
  Running setup.py install for curve25519-donna ... error
    ERROR: Complete output from command /usr/bin/python3.6 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-uyjwh9al/curve25519-donna/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-rmcoavto/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/curve25519
    copying python-src/curve25519/__init__.py -> build/lib.linux-x86_64-3.6/curve25519
    copying python-src/curve25519/keys.py -> build/lib.linux-x86_64-3.6/curve25519
    creating build/lib.linux-x86_64-3.6/curve25519/test
    copying python-src/curve25519/test/__init__.py -> build/lib.linux-x86_64-3.6/curve25519/test
    copying python-src/curve25519/test/test_curve25519.py -> build/lib.linux-x86_64-3.6/curve25519/test
    copying python-src/curve25519/test/test_speed.py -> build/lib.linux-x86_64-3.6/curve25519/test
    running build_ext
    building 'curve25519._curve25519' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/python-src
    creating build/temp.linux-x86_64-3.6/python-src/curve25519
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c python-src/curve25519/curve25519module.c -o build/temp.linux-x86_64-3.6/python-src/curve25519/curve25519module.o
    python-src/curve25519/curve25519module.c:3:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python3.6 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-uyjwh9al/curve25519-donna/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-rmcoavto/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-uyjwh9al/curve25519-donna/



回复

使用道具 举报

4

主题

63

帖子

204

积分

论坛积极会员

轮谈官吏员

积分
204
金钱
141
HASS币
0
QQ
 楼主| 发表于 2019-5-9 10:54:11 | 显示全部楼层
[root@WAYLEE ~]#     yum search python | grep python-devel
dbus-python-devel.i686 : Libraries and headers for dbus-python
dbus-python-devel.x86_64 : Libraries and headers for dbus-python
gstreamer-python-devel.i686 : Headers for developing programs that will use
gstreamer-python-devel.x86_64 : Headers for developing programs that will use
nautilus-python-devel.x86_64 : Python bindings for Nautilus
nemo-python-devel.x86_64 : Python bindings for Nemo
python-devel.x86_64 : The libraries and header files needed for Python
qscintilla-python-devel.noarch : Development files for QScintilla PyQt4 bindings
[root@WAYLEE ~]#  sudo yum install python-devel.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package python-devel-2.7.5-77.el7_6.x86_64 already installed and latest version
Nothing to do
回复

使用道具 举报

4

主题

63

帖子

204

积分

论坛积极会员

轮谈官吏员

积分
204
金钱
141
HASS币
0
QQ
 楼主| 发表于 2019-5-9 11:40:43 | 显示全部楼层
本帖最后由 waylee 于 2019-5-9 12:11 编辑

系统环境:
CENTOS 7
PYTHON3.6
Home Assistant
0.92.2

排查问题过程

1. hass首页通知homekit安装失败,提示通往官方教程
2.通过群友X提示,进入http://ip/dev-info查看日志信息,找到根本原因:缺少组件HAP-python==2.5
3.手动安装报错,报错信息指向fatal error: Python.h: No such file or directory
4. 缺少/usr/include/python3.6m/的.h文件,查看的确没有文件!
5.查阅百度,教程均无效,未找到h文件安装的方法,dev都已经安装了呀.怎么办呢.

求助群友,求助.好难,实时证明,缺乏依据和匆忙的提问,是没有人回答了,多亏了轮谈QQ群的{逍遥}\{小鬼鬼[橘子皮]}的重要提示.让我知道哪里可以看日志.

最后我选择/自/杀/ 卸载hass和Python3.x和pip.

乱投医,阴差阳错,竟然homekit成功安装了!
当时的卸载命令过程:我都一股脑yum remove \ pip uninstall把3.x和hass简单的删除了.
当时命令行的执行安装过程:
yum search python | grep python3
yum install python36
yum install shiboken-python36-devel.x86_64
sudo yum -y install epel-release
sudo yum -y install python-pip
reboot
pip3 install homeassistant
hass





回复

使用道具 举报

27

主题

2109

帖子

8566

积分

论坛元老

Rank: 8Rank: 8

积分
8566
金钱
6452
HASS币
30

论坛元老

发表于 2019-5-9 11:58:12 | 显示全部楼层
本帖最后由 情非殇 于 2019-5-9 11:59 编辑

还是docker+ha最省心,环境都是封装好的
非docker的话,官网有这么一句话,让安装,你可以试试
sudo apt-get install libavahi-compat-libdnssd-dev
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-19 20:01 , Processed in 0.055966 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表