How to install pip on Linux

Question: I want to use pip to install Python packages. However, when I run pip, it says "pip: command not found". How can I install pip on [insert your Linux distro]?

There are various ways to install and manage Python packages. One of the easiest way is to use pip command line tool. Using pip, you can install/update/uninstall a Python package, as well as list all installed (or outdated) packages from the command line.

To install pip on Ubuntu, Debian or Linux Mint:

$ sudo apt-get install python-pip

To install pip on Fedora:

$ sudo yum install python-pip

To install pip on CentOS, first enable EPEL repository, and then run:

$ sudo yum install python-pip

To install pip on Archlinux:

$ sudo pacman -S python-pip

If you want to install pip3 for python3, you can use the following commands.

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python3 get-pip.py
Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.


Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

One thought on “How to install pip on Linux

Leave a comment

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