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
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
pip works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3 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.
|
|
|
|
|
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
Install or Upgrade Setuptools
|
|
|
|
-----------------------------
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
pip requires `setuptools`_ and it has to be installed first, before pip can run. [1]_
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
To install setuptools from scratch:
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
1. Securely download `ez_setup.py <https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py>`_. [2]_
|
2011-04-04 18:00:31 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
2. Then run the following (which may require administrator access)::
|
2011-04-04 18:00:31 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
$ python ez_setup.py
|
2013-01-18 22:25:15 +01:00
|
|
|
|
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
.. warning::
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
Prior to Setuptools-1.0, `ez_setup.py` was not secure, and is currently
|
|
|
|
only secure when your environment contains secure versions of either
|
|
|
|
`curl`, `wget`, or `powershell`. [2]_ If you're not sure if you're
|
|
|
|
environment fulfills this requirement, then the safest approach is to
|
|
|
|
securely download the setuptools archive directly from `PyPI
|
|
|
|
<https://pypi.python.org/pypi/setuptools/>`_, unpack it, and run "python
|
|
|
|
setup.py install" from inside the unpacked directory.
|
2011-04-04 18:00:31 +02:00
|
|
|
|
2013-02-11 07:44:09 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
To upgrade a previous install of `setuptools`_ or `distribute`_, there are two scenarios.
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-07-06 09:03:47 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
1. You currently have setuptools or distribute *and* some version of pip::
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
$ pip install --upgrade setuptools
|
2013-07-23 19:53:54 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
If you have distribute, this will upgrade to you distribute-0.7.X, which is
|
|
|
|
just a wrapper, that depends on setuptools. The end result will be that you
|
|
|
|
have distribute-0.7.X (which does nothing) *and* the latest setuptools
|
|
|
|
installed.
|
2013-07-23 19:53:54 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
2. You currently have setuptools or distribute, but not pip:
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
Follow the pip install procedure below, then come back and run::
|
2013-02-11 07:44:09 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
$ pip install --upgrade setuptools
|
2013-07-03 06:15:52 +02:00
|
|
|
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
.. _`get-pip`:
|
2013-06-25 04:48:20 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
Install or Upgrade pip
|
|
|
|
----------------------
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
Securely download `get-pip.py <https://raw.github.com/pypa/pip/master/contrib/get-pip.py>`_. [2]_
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
Then run the following (which may require administrator access), to install (or upgrade to) the
|
|
|
|
latest version of pip::
|
2013-02-11 07:44:09 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
$ python get-pip.py
|
|
|
|
|
|
|
|
|
|
|
|
Using Package Managers
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
On Linux, pip will generally be available for the system install of python using the system package manager,
|
|
|
|
although often the latest version lags behind. Installing `python-pip` will also install `python-setuptools`.
|
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
|
|
|
|
2013-08-29 05:43:20 +02: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
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
$ sudo yum install python-pip
|
2011-03-15 06:43:03 +01:00
|
|
|
|
2013-02-11 07:44:09 +01:00
|
|
|
|
2013-08-29 05:43:20 +02:00
|
|
|
.. [1] As of pip 1.4, pip started requiring `setuptools`_, not `distribute`_
|
|
|
|
(a fork of setuptools). `setuptools`_ and `distribute`_ are now merged
|
|
|
|
back together as "setuptools".
|
|
|
|
.. [2] "Secure" in this context means using a modern browser or a
|
|
|
|
tool like `curl` that verifies SSL certificates when downloading from
|
|
|
|
https URLs.
|
|
|
|
|
|
|
|
.. _setuptools: https://pypi.python.org/pypi/setuptools
|
|
|
|
.. _distribute: https://pypi.python.org/pypi/distribute
|
2011-03-15 06:43:03 +01:00
|
|
|
|
|
|
|
|