pip/docs/installing.rst

94 lines
2.6 KiB
ReStructuredText
Raw Normal View History

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
============
.. 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
at least version 1.9, which contains pip version 1.3.
Python & OS Support
-------------------
2013-01-18 22:25:15 +01:00
pip works with CPython versions 2.5, 2.6, 2.7, 3.1, 3.2, 3.3 and also pypy.
pip works on Unix/Linux, OS X, and Windows.
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
installation. For instance::
2013-01-18 22:25:15 +01:00
$ virtualenv my_env
$ . my_env/bin/activate
(my_env)$ pip install SomePackage
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.
.. warning::
2013-02-23 00:22:37 +01:00
We advise against using `easy_install <http://pythonhosted.org/distribute/easy_install.html>`_ to install pip, because easy_install
does not download from PyPI over SSL, so the installation might be insecure.
Since pip can then be used to install packages (which execute code on
your computer), it is better to go through a trusted path.
Requirements
++++++++++++
pip requires either `setuptools <https://pypi.python.org/pypi/setuptools>`_
or `distribute <https://pypi.python.org/pypi/distribute>`_.
2013-01-18 22:25:15 +01:00
See the `Distribute Install Instructions <https://pypi.python.org/pypi/distribute/>`_ or the
`Setuptools Install Instructions <https://pypi.python.org/pypi/setuptools#installation-instructions>`_
If installing pip using a linux package manager, these requirements will be installed for you.
.. warning::
If you are using Python 3.X you **must** use distribute; setuptools doesn't
support Python 3.X.
2013-01-18 22:25:15 +01:00
Using get-pip
+++++++++++++
2011-03-15 06:43:03 +01:00
After installing the requirements:
2013-01-18 22:25:15 +01: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
Installing from source
++++++++++++++++++++++
After installing the requirements:
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