I’ve figured out how to update python without affecting the OS python installation, using pyenv.
Note: this will take a few hours of your time, between installing and building python and home-assistant.
I’m using a virtualenv install of HA, running on a Pi 2. Building python took almost 30 minutes, + you will have to reinstall homeassistant (another 30 minutes). Don’t worry about your configuration files (backup just in case), this will install a new virtualenv, so after you test to make sure everything works, you can delete the /srv/homeassistant.
Second note: I’m running Raspbian Stretch, and I understand Raspbian Buster is coming out in a few days, but I feel this will be a more maintainable installation of Hass. If this has happened once, it will happen again. Else, you don’t have to upgrade to Buster if you don’t want to. 
Run 1-6 as your homeassistant user
sudo -u homeassistant -H -s
- Install pyenv, I did the Github version, so follow 1-5. (You can replace .bash_profile with .bashrc or .bash_aliases)
- (Step 6 from above^) Choose your python version and start installing. I used 3.7.3 and it took ~30minutes.
pyenv install 3.7.3 - Install pyenv virtualenv
- Create a new virtualenv with your new python
pyenv virtualenv 3.7.3 home-assistant - Jump into this virtualenv
pyenv activate home-assistant - And install home-assistant again (~30 minutes)
python3 -m pip install wheel homeassistant - While that is installing, you can update your systemd, or other, config for Hass with a user with sudo powers. You can backup this file, to be safe.
sudo nano /etc/systemd/system/[email protected]
Change theExecStart=line toExecStart=/home/homeassistant/.pyenv/versions/home-assistant/bin/hass -c "/home/homeassistant/.homeassistant"
Runsudo systemctl daemon-reloadto make sure this change is registered with systemd. - I had Hass stopped while I was doing this, but this should work once Hass is re-installed
sudo systemctl restart [email protected]