Martin Karlsson / prog.re

Notes to self


Installing Python 3.X on Ubuntu 16.04

So, you are still running Ubuntu 16.04 in 2020. I don't judge, there are reasons, I'm sure. Crouton. Eastern European VPS providers. Anyway, the Deadsnakes team provides packages for all python versions from 3.6 to 3.9. To install:

sudo add-apt-repository ppa:deadsnakes/ppa

There is a good chance this won't work because the add-apt-repository is not available. In that case, first do:

sudo apt install software-properties-common

Then update the packages:

sudo apt update

And install the python version you want:

sudo apt install python3.6

And becase you are not crazy you are using virtual environments. But then you also need:

sudo apt install python3.6-venv

Speaking of that, to create a virual environment in the current directory:

python3.6 -m venv .

Or, have venv create the directory for you

python3.6 -m venv path/to/my/venv

Get in touch: martin [at] prog.re