Python upgrade broke HA

Yesterday I’ve upgraded Home Assistant to 0.103xx on Ubuntu 18.04.
I use HA in Virtualenv.
After every restart of the service HA kept telling me, Python 3.6 is deprecated, it needs to be updated.
So I’ve updated it to 3.7.5. Now I can’t start HA anymore. :confused:
In systemctl status I see this:

[email protected] - Home Assistant
   Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-02-18 21:38:28 CET; 11h ago
 Main PID: 26000 (code=exited, status=1/FAILURE)

febr 18 21:38:28 htpc systemd[1]: Started Home Assistant.
febr 18 21:38:28 htpc hass[26000]: Traceback (most recent call last):
febr 18 21:38:28 htpc hass[26000]:   File "/home/htpc/homeassistant/bin/hass", line 5, in <module>
febr 18 21:38:28 htpc hass[26000]:     from homeassistant.__main__ import main
febr 18 21:38:28 htpc hass[26000]: ModuleNotFoundError: No module named 'homeassistant'
febr 18 21:38:28 htpc systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
febr 18 21:38:28 htpc systemd[1]: [email protected]: Failed with result 'exit-code'.

If I try hass --open-ui in virualenv, I get this error message

Traceback (most recent call last):
  File "/home/htpc/homeassistant/bin/hass", line 5, in <module>
    from homeassistant.__main__ import main
ModuleNotFoundError: No module named 'homeassistant'

What can I do to find out, what I broke?

Probably easier to just redo your virtualenv then copy over config.

And if you don’t have a reason not to, this might be a good time to look at instructions for installing Docker over Ubuntu and running HA/hassio so you never have to worry about python upgrades.

wow. never used docker.
isn’t it going to eat up resources?

Not at all. And I did the same thing: used to use virtualenv because I was intimidated by Docker. But the docs for setting it up on Ubuntu are excellent and after that it works perfectly.

The only thing to keep in mind is the instructions online for HassIO generally assume you are running on HassOS and not Ubuntu. Just watch out for overlaps - ex. If Ubuntu is running openssh in port 22, you can’t run the HassIO addon for ssh unless you change the port (I just set my add on to use 2222 in its config). Same with samba.

Clarifying: you can’t run samba on a different port (like you can with ssh) so you have to use either the Ubuntu native package OR the HassIO addon.

I think first I’ll try to purge virtualenv.
Do you have any recommendation how to do that?

Just follow the instructions but pick a different path.

Then edit your existing systemd files to use the new location.

I’ve completly f*cked up my Python, so I’m reinstalling Linux. :frowning: