天天看点

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,如需转载请自行联系原作者