How to install python2 and pip on Ubuntu 20.04

Photo by James Harrison on Unsplash

Why to install Python2

To install Python2

sudo apt install python-minimal

The above command will download the Python2 last version (2.7.15).

Check the version using the following command

python2 --version

To check python3 version

python3 --version

To manage the Python packages we need to install pip.

Install pip for python2


a new file named will be downloaded.

Then execute the following command in the terminal


Now, you have installed pip for python2

I am going to download a python2 supported package using pip for python2 In my case, wikitools

python2 -m pip install wikitools

That’s it. We have installed the Packages for Python2



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store