天天看點

linux安裝pip2.7

安裝pip2.7必須先安裝先python2.7。如果用python2.6安裝的pip,則pip版本就是pip2.6。

前面文章已經介紹了python2.7的安裝方法,這裡不再介紹。

pip2.7的安裝

1、安裝setuptools

下載下傳位址:https://pypi.python.org/pypi?%3Aaction=search&term=setuptools&submit=search

安裝:

1

2

3

<code>tar</code> <code>zxf setuptools-19.6.2.</code><code>tar</code><code>.gz</code>

<code>cd</code> <code>setuptools-19.6.2</code>

<code>python2.7 setup.py </code><code>install</code>

<code></code>

2、安裝pip

<code>tar</code> <code>zxf pip-8.1.0.</code><code>tar</code><code>.gz </code>

<code>cd</code> <code>pip-8.1.0</code>

3、建立軟連接配接

<code>ln</code> <code>-s </code><code>/usr/local/python27/bin/pip2</code><code>.7 </code><code>/usr/bin/pip2</code><code>.7</code>

注意:pip2.7安裝完成後,生成的執行檔案在python2.7的bin目錄下

4

5

6

7

8

9

10

11

12

13

14

15

16

17

<code>[root@dnsserver bin]</code><code># ll</code>

<code>total 6184</code>

<code>-rwxr-xr-x 1 root root     110 Jan  9 10:31 2to3</code>

<code>-rwxr-xr-x 1 root root     326 Jan  9 10:59 easy_install</code>

<code>-rwxr-xr-x 1 root root     334 Jan  9 10:59 easy_install-2.7</code>

<code>-rwxr-xr-x 1 root root     108 Jan  9 10:31 idle</code>

<code>-rwxr-xr-x 1 root root     284 Jan  9 11:00 pip</code>

<code>-rwxr-xr-x 1 root root     286 Jan  9 11:00 pip2</code>

<code>-rwxr-xr-x 1 root root     290 Jan  9 11:00 pip2.7</code>

<code>-rwxr-xr-x 1 root root      93 Jan  9 10:31 pydoc</code>

<code>lrwxrwxrwx 1 root root       7 Jan  9 10:31 python -&gt; python2</code>

<code>lrwxrwxrwx 1 root root       9 Jan  9 10:31 python2 -&gt; python2.7</code>

<code>-rwxr-xr-x 1 root root 6271362 Jan  9 10:31 python2.7</code>

<code>-rwxr-xr-x 1 root root    1696 Jan  9 10:31 python2.7-config</code>

<code>lrwxrwxrwx 1 root root      16 Jan  9 10:31 python2-config -&gt; python2.7-config</code>

<code>lrwxrwxrwx 1 root root      14 Jan  9 10:31 python-config -&gt; python2-config</code>

<code>-rwxr-xr-x 1 root root   18556 Jan  9 10:31 smtpd.py</code>

<code>[root@dnsserver bin]</code><code># pip2.7 </code>

<code>Usage:   </code>

<code>  </code><code>pip &lt;</code><code>command</code><code>&gt; [options]</code>

<code>Commands:</code>

<code>  </code><code>install</code>                     <code>Install packages.</code>

<code>  </code><code>download                    Download packages.</code>

<code>  </code><code>uninstall                   Uninstall packages.</code>

<code>  </code><code>freeze                      Output installed packages </code><code>in</code> <code>requirements </code><code>format</code><code>.</code>

<code>  </code><code>list                        List installed packages.</code>

<code>  </code><code>show                        Show information about installed packages.</code>

<code>  </code><code>search                      Search PyPI </code><code>for</code> <code>packages.</code>

<code>  </code><code>wheel                       Build wheels from your requirements.</code>

<code>  </code><code>hash</code>                        <code>Compute hashes of package archives.</code>

<code>  </code><code>completion                  A helper </code><code>command</code> <code>used </code><code>for</code> <code>command</code> <code>completion</code>

<code>  </code><code>help                        Show help </code><code>for</code> <code>commands.</code>

本文轉自 曾哥最愛 51CTO部落格,原文連結:http://blog.51cto.com/zengestudy/1789497,如需轉載請自行聯系原作者