If you are working on Linux based VPS, regardless of being a VPS administrator, software developer, or others, you might have to install pip onto your VPS as long as Python programming languages are involved. Pip is a package management system that allows users to install Python packages using a terminal.
For this guide, we will be guiding you on how to install Python 2 Pip on Ubuntu 20.04. By default, Ubuntu 20.04 doesn’t have pip for Python 2, so a get-pip script is needed to install pip for Python 2.
Step 1: Update Package
Similar to most processes needed for a command-line installation, a terminal window needs to be open. To do that, you can either right-click on the desktop, and select the “Open Terminal”, or press Ctrl+Alt+T for quick access to the terminal. After that, update the repository package using the following command.
sudo apt update
Step 2: Installation
In the case in which Python 2 isn’t installed in your system, run the following command.
sudo apt install python2
Once you have Python 2 installed, install the get-pip script as mentioned earlier using the curl command as followed.
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py –output get-pip.py
After installing the get-pip.py file, you may start the pip installation by running the command below. If you wish to install pip only in your user account, remove “sudo” from the command.
sudo python2 get-pip.py
Step 3: Verifying
After the installation is completed in your Ubuntu, verification needs to be done to check if everything is installed correctly. To do so, you can check for the version downloaded on your system using the following command.
pip2 -version
The output will then be the version of pip you have installed. If no result is found, then it meant that the installation has failed, retrace the steps above again.