I did a foolish thing and updated from Ubuntu 16.10 to 17.04, hass no longer works. I installed originally using the virtualenv. If i access the virtualenv and run a upgrade i get the following errors (I assume this is why it doesn’t start)
homeassistant@lando:~/.homeassistant$ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@lando:~/.homeassistant$ pip3 install --upgrade homeassistant
Failed to import the site module
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site.py”, line 703, in
main()
File “/srv/homeassistant/lib/python3.5/site.py”, line 683, in main
paths_in_sys = addsitepackages(paths_in_sys)
File “/srv/homeassistant/lib/python3.5/site.py”, line 282, in addsitepackages
addsitedir(sitedir, known_paths)
File “/srv/homeassistant/lib/python3.5/site.py”, line 204, in addsitedir
addpackage(sitedir, name, known_paths)
File “/srv/homeassistant/lib/python3.5/site.py”, line 173, in addpackage
exec(line)
File “”, line 1, in
File “/srv/homeassistant/lib/python3.5/types.py”, line 166, in
import functools as _functools
File “/srv/homeassistant/lib/python3.5/functools.py”, line 23, in
from weakref import WeakKeyDictionary
File “/srv/homeassistant/lib/python3.5/weakref.py”, line 12, in
from _weakref import (
ImportError: cannot import name ‘_remove_dead_weakref’
same error when i try to run the start command (i tried the upgrade as i thought maybe ubuntu upgrade had damaged the installation)
tv@lando:~$ sudo -u homeassistant -H /srv/homeassistant/bin/hass
Failed to import the site module
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site.py”, line 703, in
main()
File “/srv/homeassistant/lib/python3.5/site.py”, line 683, in main
paths_in_sys = addsitepackages(paths_in_sys)
File “/srv/homeassistant/lib/python3.5/site.py”, line 282, in addsitepackages
addsitedir(sitedir, known_paths)
File “/srv/homeassistant/lib/python3.5/site.py”, line 204, in addsitedir
addpackage(sitedir, name, known_paths)
File “/srv/homeassistant/lib/python3.5/site.py”, line 173, in addpackage
exec(line)
File “”, line 1, in
File “/srv/homeassistant/lib/python3.5/types.py”, line 166, in
import functools as _functools
File “/srv/homeassistant/lib/python3.5/functools.py”, line 23, in
from weakref import WeakKeyDictionary
File “/srv/homeassistant/lib/python3.5/weakref.py”, line 12, in
from _weakref import (
ImportError: cannot import name ‘_remove_dead_weakref’
I haven’t tried on Ubuntu, but when upgrading Raspian to Stretch there was a new version of Python, so I had to recreate the Virtual Environment.
Just move the existing directory (/srv/homeassistant) and follow the instructions for installing from venv from the point of creating the venv directory.