Skip to content

Commit 9242dbf

Browse files
committed
self-contained, non-circular install instructions
1 parent b4981da commit 9242dbf

File tree

1 file changed

+53
-61
lines changed

1 file changed

+53
-61
lines changed

docs/installing.rst

+53-61
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,10 @@
33
Installation
44
============
55

6-
.. warning::
7-
8-
Prior to version 1.3, pip did not use SSL for downloading packages from PyPI, and thus left
9-
users more vulnerable to security threats. We advise installing at least version 1.3.
10-
If you're using `virtualenv <http://www.virtualenv.org>`_ to install pip, we advise installing
11-
at least version 1.9, which contains pip version 1.3.
12-
13-
146
Python & OS Support
157
-------------------
168

17-
pip v1.4 works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3 and also pypy.
9+
pip works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3 and also pypy.
1810

1911
pip works on Unix/Linux, OS X, and Windows.
2012

@@ -23,86 +15,86 @@ pip works on Unix/Linux, OS X, and Windows.
2315
Python 2.5 was supported through v1.3.1, and Python 2.4 was supported through v1.1.
2416

2517

18+
Install or Upgrade Setuptools
19+
-----------------------------
2620

27-
Using virtualenv
28-
----------------
21+
pip requires `setuptools`_ and it has to be installed first, before pip can run. [1]_
2922

30-
The easiest way to install and use pip is with `virtualenv
31-
<http://www.virtualenv.org>`_, since every virtualenv has pip (and it's dependencies) installed into it
32-
automatically.
23+
To install setuptools from scratch:
3324

34-
This does not require root access or modify your system Python
35-
installation. For instance::
25+
1. Securely download `ez_setup.py <https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py>`_. [2]_
3626

37-
$ virtualenv my_env
38-
$ . my_env/bin/activate
39-
(my_env)$ pip install SomePackage
27+
2. Then run the following (which may require administrator access)::
4028

41-
When used in this manner, pip will only affect the active virtual environment.
29+
$ python ez_setup.py
4230

43-
See the `virtualenv installation instructions <http://www.virtualenv.org/en/latest/#installation>`_.
4431

45-
Installing Globally
46-
-------------------
32+
.. warning::
4733

48-
pip can be installed globally in order to manage global packages.
49-
Often this requires the installation to be performed as root.
34+
Prior to Setuptools-1.0, `ez_setup.py` was not secure, and is currently
35+
only secure when your environment contains secure versions of either
36+
`curl`, `wget`, or `powershell`. [2]_ If you're not sure if you're
37+
environment fulfills this requirement, then the safest approach is to
38+
securely download the setuptools archive directly from `PyPI
39+
<https://pypi.python.org/pypi/setuptools/>`_, unpack it, and run "python
40+
setup.py install" from inside the unpacked directory.
5041

51-
.. warning::
5242

53-
We advise against using `easy_install <http://pythonhosted.org/setuptools/easy_install.html>`_ to install pip, because easy_install
54-
does not download from PyPI over SSL, so the installation might be insecure.
43+
To upgrade a previous install of `setuptools`_ or `distribute`_, there are two scenarios.
5544

56-
.. _`Installation Requirements`:
5745

58-
Requirements
59-
++++++++++++
46+
1. You currently have setuptools or distribute *and* some version of pip::
6047

61-
pip requires `setuptools`_.
48+
$ pip install --upgrade setuptools
6249

63-
.. warning::
50+
If you have distribute, this will upgrade to you distribute-0.7.X, which is
51+
just a wrapper, that depends on setuptools. The end result will be that you
52+
have distribute-0.7.X (which does nothing) *and* the latest setuptools
53+
installed.
6454

65-
As of pip 1.4, pip recommends `setuptools`_ >=0.8, not `distribute`_ (a
66-
fork of setuptools) and the wheel support *requires* `setuptools`_ >=0.8.
67-
`setuptools`_ and `distribute`_ are now merged back together as
68-
"setuptools".
55+
2. You currently have setuptools or distribute, but not pip:
6956

70-
For details on installing setuptools from scratch, see the install instructions
71-
on the `setuptools pypi page <https://pypi.python.org/pypi/setuptools>`_
57+
Follow the pip install procedure below, then come back and run::
7258

73-
If you already have `setuptools`_ or `distribute`_ (and pip), you can upgrade
74-
like so::
59+
$ pip install --upgrade setuptools
7560

76-
pip install --upgrade setuptools
7761

78-
If you had distribute before, this will upgrade to you distribute-0.7.X, which
79-
is just a wrapper, that depends on setuptools. The end result will be that you
80-
have distribute-0.7.X (which does nothing) *and* the latest setuptools
81-
installed.
62+
.. _`get-pip`:
8263

64+
Install or Upgrade pip
65+
----------------------
8366

84-
.. _setuptools: https://pypi.python.org/pypi/setuptools
85-
.. _distribute: https://pypi.python.org/pypi/distribute
67+
Securely download `get-pip.py <https://raw.github.com/pypa/pip/master/contrib/get-pip.py>`_. [2]_
8668

69+
Then run the following (which may require administrator access), to install (or upgrade to) the
70+
latest version of pip::
8771

88-
.. _`get-pip`:
72+
$ python get-pip.py
73+
74+
75+
Using Package Managers
76+
----------------------
77+
78+
On Linux, pip will generally be available for the system install of python using the system package manager,
79+
although often the latest version lags behind. Installing `python-pip` will also install `python-setuptools`.
8980

90-
Using get-pip
91-
+++++++++++++
81+
On Debian and Ubuntu::
9282

93-
::
83+
$ sudo apt-get install python-pip
9484

95-
$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
96-
$ [sudo] python get-pip.py
85+
On Fedora::
9786

87+
$ sudo yum install python-pip
9888

99-
Installing from source
100-
++++++++++++++++++++++
10189

102-
::
90+
.. [1] As of pip 1.4, pip started requiring `setuptools`_, not `distribute`_
91+
(a fork of setuptools). `setuptools`_ and `distribute`_ are now merged
92+
back together as "setuptools".
93+
.. [2] "Secure" in this context means using a modern browser or a
94+
tool like `curl` that verifies SSL certificates when downloading from
95+
https URLs.
96+
97+
.. _setuptools: https://pypi.python.org/pypi/setuptools
98+
.. _distribute: https://pypi.python.org/pypi/distribute
10399

104-
$ curl -O https://pypi.python.org/packages/source/p/pip/pip-X.X.tar.gz
105-
$ tar xvfz pip-X.X.tar.gz
106-
$ cd pip-X.X
107-
$ [sudo] python setup.py install
108100

0 commit comments

Comments
 (0)