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

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
0
Ivan Borshchov profile picture
May 31, 2021
by Ivan Borshchov
Did it help you?
Yes !
No

Best related