Last updated on January 14, 2021 by Dan Nanni
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
(or pip3
for Python3) command line tool. Using pip
(or pip3
), you can install/update/uninstall a Python package, as well as list all installed (or outdated) packages from the command line.
pip
on Ubuntu, Debian or Linux Mint$ sudo apt-get install python-pip # for Python2 $ sudo apt-get install python3-pip # for Python3
Note that on Ubuntu 20.04 or later, python-pip
is no longer included in their repositories. Thus if you want to install pip
on newer Ubuntu systems, you need to install it from the official source, as described at the end of this tutorial.
pip
on Fedora or CentOS/RHEL 7 or LaterNo third-party repository is needed to install pip
amd pip3
.
$ sudo yum install python-pip # for Python2 $ sudo yum install python3-pip # for Python3
pip
on CentOS or RHEL 6 or EarlierTo install pip
on old CentOS/RHEL system, first enable EPEL repository, and then run:
$ sudo yum install python-pip # for Python2
pip
on Arch Linux or Manjaro$ sudo pacman -S python2-pip # for Python2 $ sudo pacman -S python-pip # for Python3
pip
on OpenSUSE$ sudo zypper install python-pip # for Python2 $ sudo zypper install python3-pip # for Python3
pip
from the Official SourceIf you want to install pip
or pip3
from the official source directly, you can use the following commands.
pip
:$ wget https://bootstrap.pypa.io/get-pip.py $ sudo python2 get-pip.py
pip3
:$ wget https://bootstrap.pypa.io/get-pip.py $ sudo python3 get-pip.py
This website is made possible by minimal ads and your gracious donation via PayPal or credit card
Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.
Xmodulo © 2021 ‒ About ‒ Write for Us ‒ Feed ‒ Powered by DigitalOcean