You might need to install pip on your Linux-based VPS if you’re dealing with Python programming languages, regardless of whether you’re a VPS administrator, software developer, or someone else. Using a terminal, users can install Python packages thanks to the package management system Pip.
In this tutorial, we’ll show you how to set up Python 2 Pip on Ubuntu 20.04. A get-pip script is required to install pip for Python 2 because Ubuntu 20.04 by default lacks pip for Python 2.
Step 1: Update Package
A terminal window must be open, as with the majority of steps required for a command-line installation. You can either press Ctrl+Alt+T for rapid access to the terminal or right-click on the desktop and choose “Open Terminal” to achieve so. Use the following command to update the repository package after that.
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
Verification is required to see if everything was installed correctly in Ubuntu after the installation is complete. You can do this by using the following command to look up the version that was downloaded to your computer.
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.