【Linux】【Python】python2.7安装pip9.0.1
Centos7系统默认自带python2.7,但是没有安装pip。
1 [root@localhost docker-elk]# python -V 2 Python 2.7.5 3 [root@localhost docker-elk]# pip -V 4 -bash: pip: 未找到命令
首先下载并安装setuptools:
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
sudo python ez_setup.py --insecure
再到python官网下载pip安装包,解压到某个位置,我这里下载的是8.0.0版本,然后就可以安装了:
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
tar -xf pip-9.0.1.tar.gz
cd pip-9.0.1
sudo python setup.py install
ln -s /usr/local/python27/bin/pip /usr/bin/pip
1 # 安装完成 2 [root@localhost pip-9.0.1]# python -V 3 Python 2.7.5 4 [root@localhost pip-9.0.1]# pip -V 5 pip 9.0.1 from /usr/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)