2013-01-18 22:25:15 +01:00
|
|
|
.. _`Installation`:
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
Installation
|
|
|
|
============
|
|
|
|
|
|
|
|
Python Support
|
|
|
|
--------------
|
|
|
|
|
|
|
|
pip works with CPython versions 2.5, 2.6, 2.7, 3.1, 3.2, 3.3 and also pypy.
|
|
|
|
|
|
|
|
|
|
|
|
Using virtualenv
|
|
|
|
----------------
|
|
|
|
|
|
|
|
The easiest way to install and use pip is with `virtualenv
|
|
|
|
<http://www.virtualenv.org>`_, since every virtualenv has pip (and it's dependencies) installed into it
|
|
|
|
automatically.
|
|
|
|
|
|
|
|
This does not require root access or modify your system Python
|
2011-04-04 18:00:31 +02:00
|
|
|
installation. For instance::
|
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
$ virtualenv my_env
|
|
|
|
$ . my_env/bin/activate
|
|
|
|
(my_env)$ pip install SomePackage
|
2011-04-04 18:00:31 +02:00
|
|
|
|
2011-05-01 01:04:56 +02:00
|
|
|
When used in this manner, pip will only affect the active virtual environment.
|
2013-01-18 22:25:15 +01:00
|
|
|
|
|
|
|
See the `virtualenv installation instructions <http://www.virtualenv.org/en/latest/#installation>`_.
|
|
|
|
|
|
|
|
Installing Globally
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
pip can be installed globally in order to manage global packages.
|
|
|
|
Often this requires the installation to be performed as root.
|
2011-04-04 18:00:31 +02:00
|
|
|
|
2011-04-04 16:45:07 +02:00
|
|
|
Prerequisites
|
2013-01-18 22:25:15 +01:00
|
|
|
+++++++++++++
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
A global install of pip requires either `setuptools <http://pypi.python.org/pypi/setuptools>`_
|
|
|
|
or `distribute <http://pypi.python.org/pypi/distribute>`_ to be installed globally as well.
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
In many cases, these can be installed using your OS package manager.
|
|
|
|
|
|
|
|
See the `Distribute Install Instructions <http://pypi.python.org/pypi/distribute/>`_ or the
|
|
|
|
`Setuptools Install Instructions <http://pypi.python.org/pypi/setuptools#installation-instructions>`_
|
2011-04-04 16:45:07 +02:00
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
2011-04-04 18:00:31 +02:00
|
|
|
If you are using Python 3.X you **must** use distribute; setuptools doesn't
|
|
|
|
support Python 3.X.
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
Using get-pip
|
|
|
|
+++++++++++++
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2011-06-07 16:26:25 +02:00
|
|
|
Download `get-pip.py <https://raw.github.com/pypa/pip/master/contrib/get-pip.py>`_
|
2013-01-18 22:25:15 +01:00
|
|
|
and execute it using Python. This will only install pip, not the prerequisites.
|
2011-04-04 17:37:30 +02:00
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
::
|
2011-04-04 17:37:30 +02:00
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
|
|
|
|
$ [sudo] python get-pip.py
|
2011-03-15 06:43:03 +01:00
|
|
|
|
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
From source
|
|
|
|
+++++++++++
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
::
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2013-02-09 09:13:16 +01:00
|
|
|
$ curl -O https://pypi.python.org/packages/source/p/pip/pip-X.X.tar.gz
|
2013-01-18 22:25:15 +01:00
|
|
|
$ tar xvfz pip-X.X.tar.gz
|
|
|
|
$ cd pip-X.X
|
|
|
|
$ [sudo] python setup.py install
|
2011-03-15 06:43:03 +01:00
|
|
|
|