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
|
|
|
.. warning::
|
|
|
|
|
|
|
|
Prior to version 1.3, pip did not use SSL for downloading packages from PyPI, and thus left
|
|
|
|
users more vulnerable to security threats. We advise installing at least version 1.3.
|
|
|
|
If you're using `virtualenv <http://www.virtualenv.org>`_ to install pip, we advise installing
|
2013-02-18 06:53:45 +01:00
|
|
|
at least version 1.9, which contains pip version 1.3.
|
2013-02-11 07:44:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
Python & OS Support
|
|
|
|
-------------------
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-03-12 06:02:39 +01:00
|
|
|
pip v1.4 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-01-18 22:25:15 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
2013-02-11 07:44:09 +01:00
|
|
|
.. warning::
|
|
|
|
|
2013-06-25 04:48:20 +02:00
|
|
|
We advise against using `easy_install <http://pythonhosted.org/setuptools/easy_install.html>`_ to install pip, because easy_install
|
2013-02-11 07:44:09 +01:00
|
|
|
does not download from PyPI over SSL, so the installation might be insecure.
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-07-06 09:03:47 +02:00
|
|
|
.. _`Installation Requirements`:
|
|
|
|
|
2013-02-11 07:44:09 +01:00
|
|
|
Requirements
|
|
|
|
++++++++++++
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-07-23 19:53:54 +02:00
|
|
|
pip requires `setuptools`_.
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
As of pip 1.4, pip recommends `setuptools`_ >=0.8, not `distribute`_ (a
|
|
|
|
fork of setuptools) and the wheel support *requires* `setuptools`_ >=0.8.
|
|
|
|
`setuptools`_ and `distribute`_ are now merged back together as
|
|
|
|
"setuptools".
|
2013-01-18 22:25:15 +01:00
|
|
|
|
2013-06-25 04:48:20 +02:00
|
|
|
For details on installing setuptools from scratch, see the install instructions
|
|
|
|
on the `setuptools pypi page <https://pypi.python.org/pypi/setuptools>`_
|
2013-02-11 07:44:09 +01:00
|
|
|
|
2013-07-06 07:45:29 +02:00
|
|
|
If you already have `setuptools`_ or `distribute`_ (and pip), you can upgrade
|
|
|
|
like so::
|
2013-07-03 06:15:52 +02:00
|
|
|
|
2013-07-23 19:53:54 +02:00
|
|
|
pip install --upgrade setuptools
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-07-06 07:45:29 +02:00
|
|
|
If you had distribute before, 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-06-25 04:48:20 +02:00
|
|
|
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-06-25 04:48:20 +02:00
|
|
|
.. _setuptools: https://pypi.python.org/pypi/setuptools
|
|
|
|
.. _distribute: https://pypi.python.org/pypi/distribute
|
2011-04-04 16:45:07 +02:00
|
|
|
|
2013-02-11 07:44:09 +01:00
|
|
|
|
2013-08-08 01:36:02 +02:00
|
|
|
.. _`get-pip`:
|
|
|
|
|
2013-01-18 22:25:15 +01:00
|
|
|
Using get-pip
|
|
|
|
+++++++++++++
|
2011-03-15 06:43:03 +01: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-02-11 07:44:09 +01:00
|
|
|
Installing from source
|
|
|
|
++++++++++++++++++++++
|
|
|
|
|
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
|
|
|
|