@@ -27,8 +27,8 @@ pip works on Unix/Linux, OS X, and Windows.
27
27
Using virtualenv
28
28
----------------
29
29
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
30
+ If you already have virtualenv installed, then the easiest way to use pip is through `virtualenv
31
+ <http://www.virtualenv.org> `_, since every virtualenv has pip (and its dependencies) installed into it
32
32
automatically.
33
33
34
34
This does not require root access or modify your system Python
@@ -40,18 +40,66 @@ installation. For instance::
40
40
41
41
When used in this manner, pip will only affect the active virtual environment.
42
42
43
- See the `virtualenv installation instructions <http://www.virtualenv.org/en/latest/#installation >`_.
43
+ The `virtualenv installation instructions <http://www.virtualenv.org/en/latest/#installation >`_ suggest
44
+ using pip to install it if you don't already have it, though, so if the first command above doesn't work
45
+ try the next section.
44
46
45
- Installing Globally
46
- -------------------
47
+
48
+ Bootstrapping pip and virtualenv
49
+ --------------------------------
50
+
51
+ Linux
52
+ ~~~~~
53
+
54
+ On Linux, pip and virtualenv will generally be available through the system package manager.
55
+ For global installation into the system Python, it is recommended to use the system package
56
+ manager versions, and then use virtualenv as described above.
57
+
58
+ On Debian and Ubuntu::
59
+
60
+ $ sudo apt-get install python-pip python-virtualenv
61
+
62
+ On Fedora::
63
+
64
+ $ sudo yum install python-pip python-virtualenv
65
+
66
+ While these may not always be the most up to date versions of ``pip ``, virtualenv should still install a
67
+ recent version into the individual virtual environments.
68
+
69
+ Other operating systems (including Windows and Mac OS X)
70
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
+
72
+ On other operating systems, the following commands should install pip for the current user::
73
+
74
+ $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
75
+ $ python get-pip.py --user
76
+
77
+ If you don't have ``curl `` installed (for example, on Windows) you can download ``get-pip.py ``
78
+ from the given URL and run it as shown in the second command.
79
+
80
+ Once you have pip installed, you can use it to retrieve virtualenv::
81
+
82
+ $ pip install --user virtualenv
83
+
84
+ And then proceed to use virtualenv as shown above.
85
+
86
+
87
+ Installing pip for all users
88
+ ----------------------------
47
89
48
90
pip can be installed globally in order to manage global packages.
49
- Often this requires the installation to be performed as root.
91
+ As this typically requires the installation to be performed with administrator
92
+ privileges, and (on Linux systems) may conflict with packages provided through
93
+ the system package manager, it is *not * the recommended approach.
50
94
51
- .. warning ::
95
+ The simplest way to perform a global installation is to use the bootstrapping
96
+ instruction above, but running the get-pip.py script with additional privileges.
97
+ However, since running a script you downloaded from the internet with that level
98
+ of access to your system should worry you, here are some more detailed instructions
99
+ on the steps involved.
52
100
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 .
101
+ Note: the instructions below won't work on Windows. Windows users are strongly encouraged
102
+ to use the per user bootstrapping described above .
55
103
56
104
.. _`Installation Requirements` :
57
105
@@ -75,7 +123,7 @@ like so::
75
123
76
124
pip install --upgrade setuptools
77
125
78
- If you had distribute before, this will upgrade to you distribute-0.7.X, which
126
+ If you had distribute before, this will upgrade you to distribute-0.7.X, which
79
127
is just a wrapper, that depends on setuptools. The end result will be that you
80
128
have distribute-0.7.X (which does nothing) *and * the latest setuptools
81
129
installed.
@@ -84,23 +132,14 @@ installed.
84
132
.. _setuptools : https://pypi.python.org/pypi/setuptools
85
133
.. _distribute : https://pypi.python.org/pypi/distribute
86
134
87
-
88
- Using get-pip
89
- +++++++++++++
90
-
91
- ::
92
-
93
- $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
94
- $ [sudo] python get-pip.py
95
-
96
-
97
- Installing from source
98
- ++++++++++++++++++++++
99
-
100
- ::
135
+ Once a suitable version of setuptools is available, pip can be installed
136
+ from source::
101
137
102
138
$ curl -O https://pypi.python.org/packages/source/p/pip/pip-X.X.tar.gz
103
139
$ tar xvfz pip-X.X.tar.gz
104
140
$ cd pip-X.X
105
- $ [ sudo] python setup.py install
141
+ $ sudo python setup.py install
106
142
143
+ Since even these more explicit instructions still involve running an arbitrary
144
+ script from the internet with elevated privileges, the user level bootstrapping
145
+ described above is *strongly * recommended.
0 commit comments