(4)HomeAssistant安装--homeassistant安装

导航链接

 

HomeAssistant安装--homeassistant介绍

HomeAssistant安装--python3和pip

HomeAssistant安装--python3和pip分支

HomeAssistant安装--homeassistant

 

使用Pip工具安装Home Assistant

sudo pip3 install homeassistant

输出错误

Collecting homeassistant
  Downloading https://files.pythonhosted.org/packages/bc/fe/96d4e74db54548d4029cbcc64013e2447e52044d5425fcaf1fa2cd1c3354/homeassistant-0.73.1-py3-none-any.whl (2.7MB)
    100% |████████████████████████████████| 2.7MB 51kB/s 
Collecting async-timeout==3.0.0 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/96/0f/e6357458c87fb4ed8f3df215773f3caad40968f10e05552cbd8bd28415e4/async_timeout-3.0.0-py3-none-any.whl
Collecting aiohttp==3.3.2 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/72/6a/5bbf3544fe8de525f4521506b372dc9c3b13070fe34e911c976aa95631d7/aiohttp-3.3.2.tar.gz (771kB)
    100% |████████████████████████████████| 778kB 100kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "", line 1, in 
    ImportError: No module named 'setuptools'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-1i1tbvjb/aiohttp/

解决错误

sudo python3 -m pip install --upgrade --force pip

输出

Collecting pip
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 187kB/s 
Installing collected packages: pip
Successfully installed pip-10.0.1
sudo pip3 install setuptools==33.1.1

输出

Collecting setuptools==33.1.1
  Downloading https://files.pythonhosted.org/packages/e5/53/92a8ac9d252ec170d9197dcf988f07e02305a06078d7e83a41ba4e3ed65b/setuptools-33.1.1-py2.py3-none-any.whl (472kB)
    100% |████████████████████████████████| 481kB 11kB/s 
Installing collected packages: setuptools
Successfully installed setuptools-33.1.1

然后执行

sudo pip3 install homeassistant

报错

c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
     #include 
                        ^
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-a4e3d0e6/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-x6cz7r2u/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-a4e3d0e6/cffi/

执行

sudo apt-get install python3-dev

报错

c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include 
                     ^
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-2bnwkxnn/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-47mrpiah/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-2bnwkxnn/cffi/

执行

sudo  apt-get install libffi-dev

然后执行

sudo pip3 install homeassistant

如果不出意外就会安装成功

……………………
……………………
……………………
  Running setup.py clean for MarkupSafe
Failed to build pyyaml aiohttp multidict yarl idna-ssl MarkupSafe
Installing collected packages: voluptuous, idna, certifi, chardet, urllib3, requests, pytz, astral, async-timeout, attrs, pyyaml, multidict, yarl, idna-ssl, aiohttp, MarkupSafe, jinja2, homeassistant
  Running setup.py install for pyyaml ... done
  Running setup.py install for multidict ... done
  Running setup.py install for yarl ... done
  Running setup.py install for idna-ssl ... done
  Running setup.py install for aiohttp ... done
  Running setup.py install for MarkupSafe ... done
Successfully installed MarkupSafe-1.0 aiohttp-3.3.2 astral-1.6.1 async-timeout-3.0.0 attrs-18.1.0 certifi-2018.4.16 chardet-3.0.4 homeassistant-0.73.1 idna-2.7 idna-ssl-1.1.0 jinja2-2.10 multidict-4.3.1 pytz-2018.5 pyyaml-3.13 requests-2.19.1 urllib3-1.23 voluptuous-0.11.1 yarl-1.2.6

验证安装结果

hass

输出

Config directory: /home/rtplay/.homeassistant
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.core] Bus:Handling 
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.loader] Loaded introduction from homeassistant.components.introduction
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.setup] Setting up introduction
2018-07-15 11:13:35 INFO (MainThread) [homeassistant.components.introduction] 

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        Hello, and welcome to Home Assistant!

        We'll hope that we can make all your dreams come true.

        Here are some resources to get started:

         - Configuring Home Assistant:
           https://home-assistant.io/getting-started/configuration/

         - Available components:
           https://home-assistant.io/components/

         - Troubleshooting your configuration:
           https://home-assistant.io/getting-started/troubleshooting-configuration/

         - Getting help:
           https://home-assistant.io/help/

        This message is generated by the introduction component. You can
        disable it in configuration.yaml.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

首次启动需要初始化配置文件,也会自动下载一些所需的文件,会需要一些时间。有时因网络质量问题还会出现文件下载失败情况,导致启动过程受阻。此时可以关闭命令行窗口,再重新执行启动命令。

在该过程中,我尝试了将pip下载地址重新设置的方法,成功率更高。

linux的文件在~/.pip/pip.conf,如果没有则创建。

写入如下:

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

还有一些源,如下:

阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 
豆瓣(douban) http://pypi.douban.com/simple/ 
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

继续等待启动过程完成,直到使用浏览器访问192.168.0.45:8123打开Home Assistant系统首页,即表明软件安装成功。

(4)HomeAssistant安装--homeassistant安装_第1张图片

 

 

 

 

 

 

 

 

你可能感兴趣的:(自定义智能家居)