To install pip, the standard Python package manager, you typically run the get-pip.py bootstrapping script using the command python get-pip.py after downloading it from the official source at https://bootstrap.pypa.io/get-pip.py.
Installation Steps
Download the script: Use
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.pyor download the file manually.Execute installation: Run
python get-pip.pyin the terminal or command prompt where the file is saved.Verify: Check the installation by running
pip --versionorpython -m pip --version.
Platform-Specific Notes
Windows: If
pipis not recognized, you may need to add the installation directory (e.g.,C:\Python33\Scripts) to your system's PATH environment variable.Linux (Ubuntu/Debian): You can often install it directly via the package manager using
sudo apt-get install python3-pip.macOS: If using Homebrew, install Python 3 with
brew install python3, which usually includes pip; otherwise, use theget-pip.pyscript.
Important Warning
Be cautious if your Python installation is managed by your operating system or another package manager, as running get-pip.py directly may leave your system in an inconsistent state. To upgrade pip later, use the command python -m pip install -U pip.
Factsheet
» pip install pip
How to...pip install?
How to install pip with Python 3? - Stack Overflow
python - What is the official "preferred" way to install pip and virtualenv systemwide? - Stack Overflow
ELI5 what does Pip install do
Videos
Never thought I'd need to ask this question as a CCNA and Network+ holder, I guess Python has decided to make the simple act of a pip install THIS difficult, wow! I have Python installed as well as Virtual Studio Code. I try this from command prompt
pip3 install requests File "<stdin>", line 1 pip3 install requests ^^^^^^^
And that's all I get, again and again and again. So I try this in the Visual Studio terminal:
pip3 : The term 'pip3' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
-
pip3 install requests
-
+ CategoryInfo : ObjectNotFound: (pip3:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Mind blowing stuff here. I JUST want to be able to pip install. I've also tried just using "pip" and leaving out the 3. What mountains must I move to perform such a basic task? I
edit: Manual installation and use of setuptools is not the standard process anymore.
If you're running Python 2.7.9+ or Python 3.4+
Congrats, you should already have pip installed. If you do not, read onward.
If you're running a Unix-like System
You can usually install the package for pip through your package manager if your version of Python is older than 2.7.9 or 3.4, or if your system did not include it for whatever reason.
Instructions for some of the more common distros follow.
Installing on Debian (Wheezy and newer) and Ubuntu (Trusty Tahr and newer) for Python 2.x
Run the following command from a terminal:
sudo apt-get install python-pip
Installing on Debian (Wheezy and newer) and Ubuntu (Trusty Tahr and newer) for Python 3.x
Run the following command from a terminal:
sudo apt-get install python3-pip
Note:
On a fresh Debian/Ubuntu install, the package may not be found until you do:
sudo apt-get update
Installing pip on CentOS 7 for Python 2.x
On CentOS 7, you have to install setup tools first, and then use that to install pip, as there is no direct package for it.
sudo yum install python-setuptools
sudo easy_install pip
Installing pip on CentOS 7 for Python 3.x
Assuming you installed Python 3.4 from EPEL, you can install Python 3's setup tools and use it to install pip.
# First command requires you to have enabled EPEL for CentOS7
sudo yum install python34-setuptools
sudo easy_install pip
If your Unix/Linux distro doesn't have it in package repos
Install using the manual way detailed below.
The manual way
If you want to do it the manual way, the now-recommended method is to install using the get-pip.py script from pip's installation instructions.
Install pip
To install pip, securely download
get-pip.pyThen run the following (which may require administrator access):
python get-pip.pyIf
setuptoolsis not already installed,get-pip.pywill install setuptools for you.
I was able to install pip for python 3 on Ubuntu just by running sudo apt-get install python3-pip.
If you can install the latest Python (2.7.9 and up) Pip is now bundled with it.
See: https://docs.python.org/2.7//installing/index.html
If not :
Update (from the release notes):
Beginning with v1.5.1, pip does not require setuptools prior to running get-pip.py. Additionally, if setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.
I now run the regular:
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python
Here are the official installation instructions: http://pip.readthedocs.org/en/latest/installing.html#install-pip
EDIT 25-Jul-2013:
Changed URL for setuptools install.
EDIT 10-Feb-2014:
Removed setuptools install (thanks @Ciantic)
EDIT 26-Jun-2014:
Updated URL again (thanks @LarsH)
EDIT 1-Mar-2015:
Pip is now bundled with Python
http://www.pip-installer.org/en/latest/installing.html is really the canonical answer to this question.
Specifically, the systemwide instructions are:
$ curl -O http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py
The section quoted in the question is the virtualenv instructions rather than the systemwide ones. The easy_install instructions have been around for longer, but it isn't necessary to do it that way any more.


