Update virtual enviroment (python 3.6)

My Hass is running in a virtual enviroment that is set up like below. I want to update python version to get away som errors i Hass. I tried to update with help from this guide but home assistant won’t or virtual enviorment won’t start.

Any idea that is going wrong or is there another way to update pyton version on my virtual envoriment?

sudo apt-get update
sudo apt-get upgrade -y
sudo mkdir /srv  
cd /srv
sudo apt-get install python3 python3-venv python3-pip
sudo useradd -rm homeassistant
sudo mkdir homeassistant
sudo chown homeassistant:homeassistant homeassistant
sudo su -s /bin/bash homeassistant 
cd /srv/homeassistant
python3 -m venv homeassistant_venv
source /srv/homeassistant/homeassistant_venv/bin/activate
pip3 install homeassistant

Presumably you get some errors - what are they?

In htop i can see that homeassistant is running but when i try to local.ip:8123 i only get 500 internal server error - Server got itself in trouble

After a reboot of my Pi, I think the update worked out well. Some error but will dig deeper another day.