方法一:
```
下载文件
wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
执行安装
python get-pip.py
这就安装好了
```
方法二:
**pip下载:**
```
# wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate
```
pip新版本
```
https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
```
**pip安装:**
```
# tar -xzvf pip-1.5.4.tar.gz
# cd pip-1.5.4
# python setup.py install
```
提示错误:
```
[sudo] password for dslab:
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
```
安装pip时提示setup.py中使用setuptools中的模块,但是电脑中并没有安装setuptools软件包,所以我们需要先下载并安装 setuptools!
**安装setuptools软件包:**
(1)下载setuptools包
```
# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz
```
(2)解压setuptools包
```
# tar zxvf setuptools-2.0.tar.gz
# cd setuptools-2.0
```
(3)编译setuptools
```
# python setup.py build
```
(4)开始执行setuptools安装
```
# python setup.py install
```
**再次安装pip,并使用pip安装其他软件包:**
现在,setuptools已经安装好,我们再次进入pip-1.5.4目录,使用 “python setup.py install” 命令安装pip:
```
# cd pip-1.5.4/
# python setup.py install
```
安装好pip之后,我们就可以直接使用pip安装其他软件包了:
```
pip install nose
pip install virtualenv
pip install distribute
```
<font color="red" style="box-sizing: border-box;">**若安装后pip命令无法使用,搜索系统中pip文件,创建命令链接**</font>
```
ln -s /usr/local/python27/bin/pip /usr/bin/pip
```<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">