Python2环境的PIP升级到10.0.3版本后使用pip命令报错

在Centos6中默认安装的版本是python2.6,升级pip后就会导致pip命令无法使用,具体原因如下:

If you’re attempting to upgrade the version of PIP on CentOS or RHEL 6 from the default 7.1.0 to a newer version, as of April 14th 2018 when PIP 10.0.0 was released you will run into issues since EL6 ships with Python 2.6 as standard. Since you cannot upgrade the default version of Python because it will break in-built tooling such as Yum, you’ll need to version lock PIP when you upgrade it to 9.0.3. This is the last stable version of PIP that is compatible with Python 2.6

为了解决这个问题比较直接的办法就是重新安装PIP工具:

  • PIP下载
https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
  • PIP安装
tar -xzvf pip-9.0.1.tar.gz
cd pip-9.0.1
python setup.py install

参考资料:
- CENTOS/RHEL 6 PYTHON PIP ERROR, SYNTAXERROR: INVALID SYNTAX {STR(C.VERSION) FOR C IN ALL_CANDIDATES}
- linux 下 pip 安装教程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值