cyberk
(KLC)
March 1, 2017, 2:54am
1
I’ve followed the notes at the end of https://home-assistant.io/components/discovery/ and all the pre-reqs were already installed.
I’ve attempted a force-reinstall on pip3 using the following command:
pip3 install --upgrade --ignore-installed homeassistant
However, I’m still seeing the following error and discovery fails to initialize. Any help would be greatly appreciated!
Feb 28 21:48:38 raspberrypi hass[1104]: INFO:homeassistant.util.package:Attempting install of netdisco==0.8.3
Feb 28 21:48:49 raspberrypi hass[1104]: Command "/srv/homeassistant/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pv97i1zo/netifaces/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-u3kzphwa-record/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.4/netifaces --home=/tmp/tmpm4pmz640" failed with error code 1 in /tmp/pip-build-pv97i1zo/netifaces/
Feb 28 21:48:49 raspberrypi hass[1104]: ERROR:homeassistant.bootstrap:Not initializing discovery because could not install dependency netdisco==0.8.3
turboc
(Chip Cox)
March 1, 2017, 3:07am
2
try this script file. it’s brute force and the target directory may need to be adjusted to point to your HA install’s deps directory. simply ./reload_deps.sh netdisco 0.8.3 it should uninstall any other netdisco files out there and force it to install in the deps directory.
(homeassistant_venv) homeassistant@hass2:~$ cat reload_deps.sh
pip3 uninstall $1
pip uninstall $1
sudo pip3 uninstall $1
sudo pip uninstall $1
pip3 install --upgrade --target=/home/homeassistant/.homeassistant/deps $1==$2
(homeassistant_venv) homeassistant@hass2:~$
cyberk
(KLC)
March 1, 2017, 3:19am
3
Thanks for the reply, I just came back to post the fix and I saw your reply.
At first I tried recreating my venv but that didn’t fix it. The fix ended up being installing a missing dependency (like you suggested), I activated my virtualenv and installed netifaces. The steps to resolve my issue are below:
#stop hass
sudo systemctl stop home-assistant
#become homeassistant user
sudo su -s /bin/bash homeassistant
#activate venv
source /srv/homeassistant/bin/activate
#install netifaces
pip3 install netifaces
#exit venv
exit
#start hass
sudo systemctl start home-assistant
#monitor logs to confirm fix
journalctl -u home-assistant -f
And…in case it helps anyone else, presumably with a different missing dependency, this is how I found the solution:
Monitored log and identified primary error, which for me, was related to inetfaces
Googled error, for me this was “failed with error code 1 in /tmp/pip-build-thh8x2hw/netifaces/”
Found post at http://stackoverflow.com/questions/24797412/how-to-install-the-library-netifaces-for-python3-in-ubuntu-12-04
modified solution to work in my venv
turboc
(Chip Cox)
March 1, 2017, 3:32am
4
yep the netdisco install will install inetfaces