Installing Pip for Python2

Hi everyone!

Today’s topic is on Python2’s pip. By default, Python2 does not have pip automatically installed. I know some of you might be thinking won’t it be better to use pip3 which is for Python3? Well, pip for Python2 is still important especially for penetration testers or security researchers as some of the old exploits are written in Python2. As such, you have to install some libraries before using them. Let’s get started!

1. Obtaining pip installation script

The pip installation script for Python2, get-pip.py, is available in the Python Packaging Authority. You can easily download it using the following command:

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

2. Installing pip

Once you obtain the script, you can install pip for Python2 using the following command.

sudo python2 get-pip.py

3. Obtaining egg-info

This step is usually missed out on other blogs after providing steps to install pip for Python2. As such when you use pip for Python2, the terminal will complain of missing egg-info. The following command and solve that issue.

pip2 install --upgrade setuptools

I hope these tabs have been helpful to you. Feel free to leave any comments below. Do off your ad-blocker so as to support me. You may also send me some tips if you like my work and want to see more of such content. Funds will mostly be used for my boba milk tea addiction. The link is here. 🙂

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.