What is the official "preferred" way to install pip and virtualenv systemwide? What is the official "preferred" way to install pip and virtualenv systemwide? python python

What is the official "preferred" way to install pip and virtualenv systemwide?


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.


This answer comes from @webology on Twitter:

$ sudo apt-get install python-setuptools$ sudo easy_install pip$ sudo pip install --upgrade pip virtualenv virtualenvwrapper

My added notes:

  • On Mac/Windows (and Linux if the apt repo is outdated) you'd replace the first step with downloading setuptools from http://pypi.python.org/pypi/setuptools
  • On Windows you'd have to omit virtualenvwrapper from the last step and install it manually somehow. I don't know if there's a way to do this without Cygwin, but I hope so.