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
|
|
|
|
============
|
|
|
|
|
2013-02-11 07:44:09 +01:00
|
|
|
Python & OS Support
|
|
|
|
-------------------
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2014-01-15 05:59:20 +01:00
|
|
|
pip works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3, 3.4 and also pypy.
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-02-11 07:44:09 +01:00
|
|
|
pip works on Unix/Linux, OS X, and Windows.
|
|
|
|
|
2013-03-12 06:02:39 +01:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
Python 2.5 was supported through v1.3.1, and Python 2.4 was supported through v1.1.
|
|
|
|
|
|
|
|
|
2014-01-10 05:13:30 +01:00
|
|
|
.. _`get-pip`:
|
|
|
|
|
2014-03-26 19:05:23 +01:00
|
|
|
Install pip
|
|
|
|
-----------
|
2014-01-10 05:13:30 +01:00
|
|
|
|
2014-01-15 05:59:20 +01:00
|
|
|
To install or upgrade pip, securely download `get-pip.py
|
2014-05-03 00:55:39 +02:00
|
|
|
<https://bootstrap.pypa.io/get-pip.py>`_. [1]_
|
2014-01-10 05:13:30 +01:00
|
|
|
|
2014-01-15 05:59:20 +01:00
|
|
|
Then run the following (which may require administrator access)::
|
2014-01-10 05:13:30 +01:00
|
|
|
|
2014-03-26 19:05:23 +01:00
|
|
|
python get-pip.py
|
2014-01-10 05:13:30 +01:00
|
|
|
|
2014-02-12 07:13:03 +01:00
|
|
|
If `setuptools`_ (or `distribute`_) is not already installed, ``get-pip.py`` will
|
|
|
|
install `setuptools`_ for you. [2]_
|
2014-01-10 05:13:30 +01:00
|
|
|
|
2014-04-09 07:57:22 +02:00
|
|
|
Additionally, ``get-pip.py`` supports using the :ref:`pip install options <pip
|
|
|
|
install Options>` and the :ref:`General Options`. Below are some examples:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
# Install from local copies of pip and setuptools
|
|
|
|
python get-pip.py --no-index --find-links=/local/copies
|
|
|
|
|
|
|
|
# Install to the user site
|
|
|
|
python get-pip.py --user
|
|
|
|
|
|
|
|
# Install behind a proxy
|
|
|
|
python get-pip.py --proxy="[user:passwd@]proxy.server:port"
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2014-06-19 23:27:22 +02:00
|
|
|
To enable the use of pip from the command line, ensure the ``Scripts`` subdirectory of
|
|
|
|
your Python installation is available on the system PATH. (This is not done automatically.)
|
2013-08-29 05:43:20 +02:00
|
|
|
|
2014-04-09 07:57:22 +02:00
|
|
|
To upgrade an existing `setuptools`_ (or `distribute`_), run ``pip install -U setuptools`` [3]_
|
|
|
|
|
|
|
|
|
2014-03-26 19:05:23 +01:00
|
|
|
Upgrade pip
|
|
|
|
-----------
|
|
|
|
|
|
|
|
On Linux or OS X:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
pip install -U pip
|
|
|
|
|
|
|
|
|
|
|
|
On Windows [4]_:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
python -m pip install -U pip
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
Using Package Managers
|
|
|
|
----------------------
|
|
|
|
|
2014-01-15 05:59:20 +01:00
|
|
|
On Linux, pip will generally be available for the system install of python using
|
|
|
|
the system package manager, although often the latest version will be
|
|
|
|
unavailable.
|
2013-08-08 01:36:02 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
On Debian and Ubuntu::
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2014-03-26 19:05:23 +01:00
|
|
|
sudo apt-get install python-pip
|
2011-04-04 17:37:30 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
On Fedora::
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2014-03-26 19:05:23 +01:00
|
|
|
sudo yum install python-pip
|
|
|
|
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2014-03-26 19:05:23 +01:00
|
|
|
----
|
2013-02-11 07:44:09 +01:00
|
|
|
|
2014-01-15 05:59:20 +01:00
|
|
|
.. [1] "Secure" in this context means using a modern browser or a
|
2013-08-29 05:43:20 +02:00
|
|
|
tool like `curl` that verifies SSL certificates when downloading from
|
|
|
|
https URLs.
|
|
|
|
|
2014-02-12 07:13:03 +01:00
|
|
|
.. [2] Beginning with pip v1.5.1, ``get-pip.py`` stopped requiring setuptools to
|
|
|
|
be installed first.
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2014-02-12 07:13:03 +01:00
|
|
|
.. [3] Although using ``pip install --upgrade setuptools`` to upgrade from
|
|
|
|
distribute to setuptools works in isolation, it's possible to get
|
|
|
|
"ImportError: No module named setuptools" when using pip<1.4 to upgrade a
|
|
|
|
package that depends on setuptools or distribute. See :doc:`here for
|
|
|
|
details <distribute_setuptools>`.
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2014-03-26 19:05:23 +01:00
|
|
|
.. [4] https://github.com/pypa/pip/issues/1299
|
|
|
|
|
2014-02-12 07:13:03 +01:00
|
|
|
.. _setuptools: https://pypi.python.org/pypi/setuptools
|
|
|
|
.. _distribute: https://pypi.python.org/pypi/distribute
|