Last updated on January 14, 2021 by Dan Nanni
pipto install Python packages. However, when I run
pip, it says "pip: command not found". How can I install
pipon [insert your Linux distro]?
There are various ways to install and manage Python packages. One of the easiest way is to use
pip3 for Python3) command line tool. Using
pip3), you can install/update/uninstall a Python package, as well as list all installed (or outdated) packages from the command line.
pipon 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.
pipon Fedora or CentOS/RHEL 7 or Later
No third-party repository is needed to install
$ sudo yum install python-pip # for Python2 $ sudo yum install python3-pip # for Python3
pipon CentOS or RHEL 6 or Earlier
pip on old CentOS/RHEL system, first enable EPEL repository, and then run:
$ sudo yum install python-pip # for Python2
pipon Arch Linux or Manjaro
$ sudo pacman -S python2-pip # for Python2 $ sudo pacman -S python-pip # for Python3
$ sudo zypper install python-pip # for Python2 $ sudo zypper install python3-pip # for Python3
pipfrom the Official Source
If you want to install
pip3 from the official source directly, you can use the following commands.
$ wget https://bootstrap.pypa.io/get-pip.py $ sudo python2 get-pip.py
$ 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