How to install pip on Ubuntu – Python Package Manager

pip is a free and open source Python package manager for Linux, macOS, Windows and Unix. Using pip you can easily install and manage python packages from Python Package Index (PyPI) online repository or any other indexes on your system. It is released under MIT license. In this tutorial i am going to install pip python package manager for Python 3 and Python 2.

Note: Python 2 officially in end-of-life and Python 2.7.18 is the last stable release of Python 2, released on April 20, 2020. Python 2 is not installed by default on Ubuntu 20.04. So Python users please switch to Python 3.

Install pip Python Package Manager on Ubuntu:

You don’t need to install Python 3 on ubuntu, it comes as per-installed with Ubuntu. You can check the installed python 3 version by below in terminal.

python3 --version

Install pip for Python 3:

Open your terminal app (ctrl+alt+t) and run this command to update your ubuntu source list.

sudo apt update

Enter your Ubuntu password. Then this pip installation command.

sudo apt install python3-pip

Then verify your pip installation with this command.

pip3 --version

Install pip for Python 2:

First check if python 2 comes with your system with this command.

python --version

If you get “Command ‘python’ not found“, then you need to install python 2 first. Enable the ubuntu universe repository. You can enable via below command also.

sudo add-apt-repository universe

Then enter the below command in terminal and install python 2.

sudo apt install python2

Then install curl on your system if you don’t have.

sudo apt install curl

Then download the pip installer script.

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

Then run this command to install pip for python 2.

sudo python2 get-pip.py

It will also install setuptools and wheel. check the installed version by

pip --version

PIP Usage:

pip3 --help

Example:

Suggested Read:  How to install Oolite on Ubuntu - 3D Space Trading and Combat Game

Install python package via pip

sudo pip3 install PACKAGENAME

Uninstall python package via pip

sudo pip3 uninstall PACKAGENAME

That’s all.

You may also like...

3 Responses

  1. May 9, 2020

    […] How to install pip on Ubuntu […]

  2. May 19, 2020

    […] this you need to install the pip python package manager. Follow this link to install and setup in Ubuntu. Then run this command to install ddgr in Ubuntu via […]

  3. May 22, 2020

    […] Install pip on Ubuntu […]

Leave a Reply

Your email address will not be published. Required fields are marked *