That version does not exist as a package for Ubuntu 16.04.
3.6 perhaps?
Unfortunately the latest version is 3.5.2.
Waiting for Ubuntu 18.04 LTS is not really an option; its release date is 26 April, and a do-release-upgrade
usually only works from the following minor release onwards.
I am currently in the process of going down the following path with an unofficial package:
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
sudo apt-get install python3-venv
Next steps is upgrading the virtual environment…
Gave this a try but had to manually install several python packages, something weird with permissions. Gave up and installed ubuntu 17.10 LXC container for HA.
I am also on Ubuntu 16.04, trying to upgrade from 0.64.3 to 0.65.2.
Error: “homeassistant requires Python ‘>=3.5.3’ but the running Python is 3.5.2”
But 3.5.2 is the latest Python for Ubuntu 16.04!
Will stick to 0.64.
(By the way: I am not using a virtual environment)
I just upgraded python to 3.6 on Ubuntu 16.04 and I can confirm it works, but I use virtual environments and I strongly to advise you to make use of that if you want to keep Ubuntu 16.04 as you might break the system when replacing python 3.5.2 by 3.6.
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
sudo apt-get install python3.6-venv
sudo apt-get install python3.6-dev
After that you’d just follow the guide https://home-assistant.io/docs/installation/virtualenv/.
But the venv should be created with the required python version (explicit):
python3.6 -m venv homeassistant
Any advice on how to do this on a Mac? I downloaded and installed Python 3.6 from the web but HA still uses 3.5.2. Ideas?
You have to create the venv with the python version (explicit) like so:
python3.6 -m venv homeassistant
Yes I had to do what cgtobi says. Install python3.6, delete my old venv and create a new one using 3.6.
I also needed to install python3.6-dev.
Thanks but still having a problem. I’m assuming it’s due to permissions because HA starts but the front end won’t load and Safari throws a 500 server got itself in trouble error. Ideas?
Depending on what components you use it takes a while to install all dependencies. Check with top
and/or ps -ef
what is running.
Thanks @cgtobi.
I followed the same approach, but had to be more specific for the venv and dev packages.
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
sudo apt-get install python3.6-venv
sudo apt-get install python3.6-dev
My original attempt to upgrade the existing virtual environment failed; instead I ended up installing HA into a new directory and copied over my old configuration files.
Edit: Removed the following line from the above which activates Python 3.6 globally and which is not necessary when installing HA in a cirtual environment:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
You’re right. I’ll fix that in the other post as well so that others don’t make that same mistake. Thanks for pointing that out.
Technically, if you’re using virtual environments, you shouldn’t need to use update-alternatives
. To my understanding it might actually even damage your system. Just my 2 cents.
Yes, you’re right, that setting activates that Python version globally; not required when using virtual environments.
Thanks for this, I’m in the same boat with Ubuntu 16.01.
Just to confirm, do I then need to be explicit for all commands? e.g. python3.6 -m pip install wheel
or just python3 -m pip install wheel
?
Consider using Docker. No big difference from a Python Virtual Environment to a Docker container, except Docker does not mess up your Python install.
- Install it for Ubuntu according do documentation.
- Run it using your current configuration (copy and paste):
docker run --rm --net=host --name="home-assistant" \
-v /path/to/your/config:/config \
-v /etc/localtime:/etc/localtime:ro \
homeassistant/home-assistant:0.65.3`
Next time a new Home Assistant version is released, stop the container (includes implicit removal)
docker stop hass
and run the above command again using the new release number. Infact, you can use any release number, so downgrade is easy as well. You could also use homeassistant/home-assistant:latest instead a version number to always get the latest released number.
Thanks having a go at trying Docker.
Can you explain why your command is different from HA’s official one?
The official one
docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant
differs in two aspects from mine, because:
- the “-p” option (port) on my version makes no sense when --net=host is use. Simply discard it, it’s from legacy experiments.
- the “–rm” option (remove, mind the double dash) removes the container instance when it is stopped. This way you can use the “run” command before having to remove the container (“docker rm hass”) first. Containers should be ephemeral, no data inside the container is persistent.
- the explicit version number for the image homeassistant/home-assistant is missing in the official version, which makes Docker to use the image version tagged as “latest”.
- the “–name” option defines just a symbolic name for the container, so you can use this name with commands like “docker logs”, “docker stop” etc. A name to choose is up to you. Infact “home-assistant” is a better choice, because for Germans (like me) “hass” is the German translation of “hate”
I updated my first version above, removed the -p option and adjusted the symbolic name from “hass” to “home-assistant”.
Thanks. I guess I have a bit of work to get used to / learn docker:
I can’t access the web interface (I was using SSL on my standard HA instance) and I’ll need to authorise / map access to USB devices, like my RFXTrx transceiver, etc.