Ubuntu – Installing python3.7 alongside python3.6 in ubuntu 18.04

package-managementpythonpython3

I would like to install python3.7 alongside python3.6 in Ubuntu 18.04.

I run all code in Pipenv's, so I don't want any system resources to depend on python3.7, I just want the binary to be available for future virtualenvs.

There is the python3.7-minimal package in bionic-updates that apt-file says only installs the binary, but I don't know if apt-file is showing symlinks or there is some configuration that happens after installation to make 3.7 the default.

So, I'm curious what happens when you install the python3.7 package on a system that already uses python3.6.

Best Answer

On my 18.04 system, I installed python3.7 by running the following commands:

sudo apt update
sudo apt install python3.7

Now, when I run the following command:

python3 -V

I get the following response:

Python 3.6.8

However, when I run the following command:

python3.7 -V

I get the following response:

Python 3.7.3

It seems that 3.7 is available but 3.6.8 is still the default.