3
3
Installation
4
4
============
5
5
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
-
14
6
Python & OS Support
15
7
-------------------
16
8
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.
18
10
19
11
pip works on Unix/Linux, OS X, and Windows.
20
12
@@ -23,86 +15,86 @@ pip works on Unix/Linux, OS X, and Windows.
23
15
Python 2.5 was supported through v1.3.1, and Python 2.4 was supported through v1.1.
24
16
25
17
18
+ Install or Upgrade Setuptools
19
+ -----------------------------
26
20
27
- Using virtualenv
28
- ----------------
21
+ pip requires `setuptools `_ and it has to be installed first, before pip can run. [1 ]_
29
22
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:
33
24
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 ]_
36
26
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)::
40
28
41
- When used in this manner, pip will only affect the active virtual environment.
29
+ $ python ez_setup.py
42
30
43
- See the `virtualenv installation instructions <http://www.virtualenv.org/en/latest/#installation >`_.
44
31
45
- Installing Globally
46
- -------------------
32
+ .. warning::
47
33
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.
50
41
51
- .. warning ::
52
42
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.
55
44
56
- .. _`Installation Requirements` :
57
45
58
- Requirements
59
- ++++++++++++
46
+ 1. You currently have setuptools or distribute *and * some version of pip::
60
47
61
- pip requires ` setuptools `_.
48
+ $ pip install --upgrade setuptools
62
49
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.
64
54
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:
69
56
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::
72
58
73
- If you already have `setuptools `_ or `distribute `_ (and pip), you can upgrade
74
- like so::
59
+ $ pip install --upgrade setuptools
75
60
76
- pip install --upgrade setuptools
77
61
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` :
82
63
64
+ Install or Upgrade pip
65
+ ----------------------
83
66
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 ]_
86
68
69
+ Then run the following (which may require administrator access), to install (or upgrade to) the
70
+ latest version of pip::
87
71
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 `.
89
80
90
- Using get-pip
91
- +++++++++++++
81
+ On Debian and Ubuntu::
92
82
93
- ::
83
+ $ sudo apt-get install python-pip
94
84
95
- $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
96
- $ [sudo] python get-pip.py
85
+ On Fedora::
97
86
87
+ $ sudo yum install python-pip
98
88
99
- Installing from source
100
- ++++++++++++++++++++++
101
89
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
103
99
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
108
100
0 commit comments