How to install python2 and pip on Ubuntu 20.04

Photo by James Harrison on Unsplash

Why to install Python2

Most of the applications are now shifted to Python3 and becoming re-written source code. But somehow, some of the not evolving scripts which were written on Python2 needs to be executed with the help of 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

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py

a new file named get-pip.py will be downloaded.

Then execute the following command in the terminal

python2 get-pip.py

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

--

--

--

A passionate in Tech https://www.linkedin.com/in/parathantl

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Designing Storage for a Database Using SQL Server

Open-Sourcing Shoelaces: A Tool for Unmanned Server Bootstrapping

Ruby vs Elixir performance ; Ultron is dead, long live UltronX

Serving up HTML with Go

Enhancing your game with QA, part 2: Growing in-house

Blogs: Week of 1 Nov — 7 Nov

CS373 Spring 2021: Sruthi Rudravajjala

Terraform Module Design

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
Parathan Thiyagalingam

Parathan Thiyagalingam

A passionate in Tech https://www.linkedin.com/in/parathantl

More from Medium

Could not import : FLASK_APP

Python cursor’s fetchone(), fetchmany() to read records from database table

Multiprocessing — Simple Guide to Create Processes and Pool of Processes in Python

Flask, from zero to hero: the complete tutorial (work in progress).