really odd thing about this – spotify card isn’t showing even if it was successfully authenticated (there’s a .spotify-token-cache). debug doesn’t help at all.
i tried to use the 3.4 virtual environment ( i just moved it instead of deleting), and spotify shows using it.
EDIT: solved. had to put cache_path after upgrade to python 3.6. i might have set an env on the 3.4 environment.
Nice one. Interested to know more as i’ve been meaning to do this. Haven’t grasped github just yet. Makes me wonder if cron job or some HASSIO feature I haven’t yet read about just yet.
I successfully (so far at least) went to Python 3.6.5 using the guide, so massive thanks to @turboc for putting it all in one place. The only issue I had wasn’t from this guide, but I thought it might help someone doing what I did while following the guide.
After following the guide and restarting HA, I got a python error importing the pip.locations function. When I decided to upgrade Python to the latest release (and deal with any issues along the way), I also followed the pip notification that pip 10.0.0 was out and I was running 9.0.1, and upgraded to the latest version there too. That was the issue, so I had to downgrade to pip 9.0.3 (using pip3 install pip=9.0.3). More details in this thread (huge thanks to @pemontto for that post).
Anybody running hass/pi with 3.7.x? If yes, which version exactly and what steps did you follow? Please include your hass version as well. I’m on 3.6.3 and I think it’s a root cause for a lot of the google assistant errors i’m getting in the logs.
I’m running 3.7.3 without issue, I usually upgrade when I see the notification come out.
I don’t do anything special, just download the package from the python page, unzip, configure/make/make install.
Minor updates e.g. 3.7.x, 3.6.x don’t require anything further done (files are already named python3.7, so just overwrite each other; the minor revision is dropped off), but going from one to another e.g. 3.6->3.7 you’ll need to re symlink python3->python3.7 in /usr/loca/bin/
sudo systemctl stop [email protected]
cd /tmp
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar xzvf Python-3.7.3.tgz
cd Python-3.7.3/
./configure
make -j 4
sudo make install
python3 -V
python3 -m pip install --upgrade pip
sudo systemctl start [email protected]
Replace 3.7.3 with the desired version and you can hop around python versions as much as you want.
Be aware the “make -j 4” line can cause the Pi to lock up. Either re-run the command until it works or use a number smaller than 4 and deal with the long make times.
This is great, thank you! I’ll give this a swirl over the weekend and report back. I do remember the make command taking a while when I upgraded to 3.6.3. It was a roller coaster of feelings tempting me to intervene. At the end, my better half left it alone and it finally finished lol As always, I always make a copy of the SD card before making major changes as such.
Now that HA versions after 0.94.0 will deprecate Python 3.5, I will need to upgrate it from 3.5.3 to 3.7.3.
Can I use your steps above to update it?
I am using a Pi3 with Raspbian Strech Lite , Python 2.7.13 and 3.5.3.
Thanks!
You should be renaming your pi account as a matter of good practice. Homeassistant account should never have superuser rights so you won’t be running it there.
Run it on whatever superuser account you use to administer your machine.
I’ve just updated mine to Python 3.7.3 successfully, but needed to use the following:
./configure --enable-shared --enable-loadable-sqlite-extensions
make
sudo make install
sudo ldconfig -v
I believe the –enable-shared (and the addiitional ldconfig step) is the equivalent of installing python-dev, and –enable-loadable-sqlite-extensions enables the sqlite3 module (without it I was getting the error No module named ‘_sqlite3’).
If those commands successfully upgraded python, you must not be running Python in a venv as recommended & listed in the subject of this thread.
Your commands would only upgrade python in the OS, not the venv.
The advantage ( and now, the problem) with a Python venv is that it is unaffected by the python & module versions in the OS. If the venv is actually isolating as designed it would not change versions like that.
The venv would need to be deleted & re-created and the modules reinstalled in the new venv.