Upgrading Python in a virtualenv

I used these direction to run HASS in a virtualenv on RPI3

activating the virtualenv with “source /srv/homeassistant/bin/activate”
and “python --version” gives me Python 3.4.2

how do I upgrade my python in the virtualenv to 3.6

You actually need to create a new virtual environment. If you already have python 3.6 installed, remove (or move) the old virtual environment /srv/homeassistant and create a new one by following the same instructions, but using

virtualenv -p python3.6 /srv/homeassistant

which specifies which version of python to use for this venv.

virtualenv --help

shows all the options

I searched the forum and found this instruction

2 Likes