# As root
apt-get update
apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar zxf Python-3.7.3.tgz
cd Python-3.7.3/
./configure --prefix=/usr
make -j 4
make altinstall
systemctl stop home-assistant
# Switch to Home Assistant User
sudo su - homeassistant
cd /home/homeassistant/
python3.7 -m venv homeassistant_venv
source /home/homeassistant/homeassistant_venv/bin/activate
pip install --upgrade pip
wget https://raw.githubusercontent.com/home-assistant/home-assistant/master/requirements_all.txt -O requirements_all.txt
# This takes hours to finish and you may need to install additional failed dependecies if you get errors
pip install -r requirements_all.txt
pip install mysqlclient
pip install homeassistant
# Go back to root
exit
# edit systemd service unit for new virtualenv
#vim /etc/systemd/system/home-assistant.service
#"ExecStart=/home/homeassistant/homeassistant_venv/bin/hass -c "/home/homeassistant/.homeassistant"
systemctl daemon-reload
systemctl start home-assistant
Your quote sudo -u homeassistant -H -s changes from the pi user to the homeassistantuser. I expect your configuration folder is/home/homeassistant/.homeassistant` and owned by that user.
For your first issue, if you were in the venv, it should work as the 1homeassistant1 user.
For your second issue, are you sure step 19 finished with no errors? in the venv as the homeassistant user you should be able to run home assistane manually by typeing hass.
For your third issue, if you are outside the venv the proper commane would be python3.7 --version You are seeing the older installer version.
In the venv python --version and python3 --version should bothe return the proper value.
Yes, my configuration is at: /home/homeassistant/.homeassistant
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/srv/homeassistant/bin/pip'
Consider using the `--user` option or check the permissions.
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(homeassistant) homeassistant@hassbian:/home/pi $
As you see above, I believe that I am running as homeassistant user inside the venv.
For #2, nothing wrong called my attention. Can I run it again?
The hint is in what pip advises you to do. Use —user. Once that’s done, sort out owner/permissions issues, update to the latest version of Hass and you’ll find you’re back up and running with Python 3.7.3 and the latest version of Hass.
Got it to work running steps 15 to 19 again, but as homeassistant user. I run as pi before, that was the problem. Running now 0.94.2 with python 3.7.3 being reported in system health.
I could see some errors in the log after running “hass” that I will see how it goes and report back if needed.
THANK YOU VERY MUCH for your help. And also everybody that helped to fine tune the code. I could not achieve this alone. There is always a lot to learn.
Stream is not working. I installed ffmpeg once, but don’t use it anymore for a camera. Anyway stream is not working anymore.
I am trying this for the “av==6.1.2” problem.
I had to wait an hour to confirm that it worked.
- sudo apt install autoconf automake build-essential cmake libass-dev libfreetype6-dev libjpeg-dev libtheora-dev libtool libvorbis-dev libx264-dev pkg-config wget yasm zlib1g-dev
- wget http://ffmpeg.org/releases/ffmpeg-3.2.tar.bz2
- tar -xjf ffmpeg-3.2.tar.bz2
- cd ffmpeg-3.2
- ./configure --disable-static --enable-shared --disable-doc
- make
- sudo make install
Worked great for me. The only extra thing is to ensure that the virtual env directory is owned by the homeassistant user, if you are running it like that. in my case:
Thank god for your efforts here. The Hassbian upgrade script killed my Home assistant and your comment here helped me recover my sqllite database. FYI after step 19, i did have to run the hassbian homeassistant install script again and then all was working.
Thanks for taking the time to make these detailed instructions available.
I followed the procedure as described, and it worked very smoothly with one small exception. I didn’t have any problems with zeroconf or openzwave, but the first time I loaded the modules from requirements.txt, it aborted with the message:
pkg-resources==0.0.0 (from -r /tmp/requirements.txt (line 40)) (from versions: )
No matching distribution found for pkg-resources==0.0.0 (from -r /tmp/requirements.txt (line 40))
I think that may have been something added long ago that is no longer used. I commented out that line and it ran to completion on the next attempt. No more nagging from HA about my python version!