The recommended way to use pip is within virtualenv, since every virtualenv has pip installed in it automatically. This does not require root access or modify your system Python installation. For instance:
$ curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
$ python virtualenv.py my_new_env
$ . my_new_env/bin/activate
(my_new_env)$ pip install ...
When used in this manner, pip will only affect the active virtual environment. If you do want to install pip globally into your Python installation, see the instructions below.
Prior to installing pip make sure you have either setuptools or distribute installed. Please consult your operating system’s package manager or install it manually:
$ curl http://python-distribute.org/distribute_setup.py | python
Warning
If you are using Python 3.X you must use distribute; setuptools doesn’t support Python 3.X.
Download get-pip.py and execute it, using the Python interpreter of your choice:
$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
This may have to be run as root.
You can find the source on PyPI:
$ curl -O http://pypi.python.org/packages/source/p/pip/pip-1.0.tar.gz
$ tar xvfz pip-1.0.tar.gz
$ cd pip-1.0
$ python setup.py install # may need to be root
First you will need to clone the git repo:
$ git clone https://github.com/pypa/pip.git
Now we can install from the repo:
$ cd pip
$ python setup.py install # may need to be root