How to install the exact python version on Ubuntu/Windows WSL 2

Today, 4th December 2022, Ukraine is still bravely fighting for democratic values, human rights and peace in whole world. Russians ruthlessly kill all civilians in Ukraine including childs and destroy their cities. We are uniting against Putinโ€™s invasion and violence, in support of the people in Ukraine. You can help by donating to Ukrainian's army.

If you are on Windows follow WSL 2 installation guide first.

Add dead snakes PPA, this is a special DEB repository that holds all python versions. Compatible with all Debian bases repositories: Ubuntu, Mint, WSL2 Ubuntu

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa

Now type the next command to install the main python DEB package of a specific version:

sudo apt install python3.7

Instead of 3.7 use any version you need.

For some specific projects and packages you might also need other DEB packages:

Image for a hint

#python #pip
Ivan Borshchov profile picture
May 31, 2021
by Ivan Borshchov
Did it help you?
Yes !

Best related