在Centos6中默認(rèn)安裝的版本是python2.6蠢壹,升級pip后就會導(dǎo)致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
參考資料: