参考:https://blog.youkuaiyun.com/bin8632/article/details/88732501
找不到rpm库文件 -> 添加epel源
yum -y install epel-release
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install python-pip
plus:出现如下错误
Requires: python(abi) = 2.6
Installed: python-2.7.5-34.el7.x86_64 (@anaconda)
Error: Package: python-pip-7.1.0-1.el6.noarch (epel)
Requires: python(abi) = 2.6
Installed: python-2.7.5-34.el7.x86_64 (@anaconda)
python(abi) = 2.7
python(abi) = 2.7
Available: python-2.7.5-76.el7.x86_64 (base)
python(abi) = 2.7
python(abi) = 2.7
Available: python-2.7.5-77.el7_6.x86_64 (updates)
python(abi) = 2.7
python(abi) = 2.7
Available: python34-3.4.8-1.el6.i686 (epel)
python(abi) = 3.4
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
CentOS7,有的默认安装版本是2.7,要求2.6 版本不兼容。
这时候,可以采用wget来安装Python环境(注意到网上有建议yum updated的。这是个危险的操作,升级所有包同时也会升级软件和系统内核,由于系统与硬件的兼容性问题,有可能升级内核后导致服务器不能正常启动,这是非常可怕的,没有特别的需要,建议不要随意升级内核)
1. wget https://bootstrap.pypa.io/get-pip.py
2. sudo python get-pip.py
3. pip -V 确认安装成功
over.