Hello, I have a home assistant on raspbian and I have read that now in the next versions Python 3.7 will no longer be valid and we have to use the new version. 3.9 (it is possible to update)
Can someone explain to me how to update my version of Python to the latest version, so that I can continue the same with my HA server thanks!I leave you a screenshot of my installation.
Add far as I know, you need to build your own python version and then recreate your environment to use the new executable. Be careful, some guides will overwrite the base python3 version to 3.9 (or whatever you are building)
Ok, that’s the problem that right now I can’t do a clean installation, and I wanted to update the version I have now with some easy manual, why don’t I have too much knowledge
I don’t know if it is possible to find a guide to do this version update.
Nice tutorial. You may want to update to use make altinstall instead of make install as recommended by the Python installation guide. My understanding is that altinstall does not change the default python3 version which could be important if other services depend on this.
Thanks for the answer I think it is what I needed, evident adjusting the version to the latest available … I will try it. I have the installation as it is described and with the same directories.
So I understand that it is to follow the commands step by step.
I see that what we do is install the whole system again from 0 and what is done is a backup copy of the folder where the HA server is installed that is then restored, correct?
Basically yeah, you download and install the new python version, backup your homeassistant configuration, delete your old venv, create a new venv based on the new python version, install homeassistant in the new venv and restore your backed up configuration. Takes about 10 minutes
We are currently working on ensuring Python 3.9 is fully supported and tested.
Upgrade to Python 3.8.6, sure, but Python 3.9 may result in stuff not working. Based on the 3.8 transition, I’d upgrade that may to a will, but nobody has confirmed this yet
This is how I upgrade my Python and create a new venv. I don’t blow away the old one, so that if things go wrong a rollback is easy. I’ve also written a script to do all the hard work. You pass in the version of Python and it’ll build and (alt)install that Python version, with all the right settings. Then it creates a new venv, installs the pre-requisites that HA doesn’t handle, and runs a check to speed up first startup slightly.
I would agree to hold off for at least the next version of HA before upgrading. The deprecation cycle is brutally fast in HA, we shouldn’t deprecate something before it’s replacement can at least be recommended.
Python has also announced starting 12 month releases, so upgrading one version at a time means repeating this cycle every year. I wouldn’t recommend upgrading to 3.8.x unless for some reason you had to do it now rather than in 2 or 3 weeks.
To be honest, upgrading Python (if you’re not on a Pi) is pretty painless, and it usually takes a lot longer than a few weeks for the new Python version to be validated. I’ve been running 3.7.3 until the deprecation notice was released, having upgraded to that only when 3.6 was deprecated.
At best, I’d follow the Docker containers, upgrading only when they update. Updating once a year is easy enough, and if it’s not then it’s probably time to switch to Docker