linux升级Python 2.7.14后pip功能报错的解决方法
Could not find a version that satisfies the requirement tempora==1.8 (from flexget) (from versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.6.1)No matching distribution found for tempora==1.8 (from flexget)
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
# pip -V
pip 9.0.2 from /usr/lib/python2.6/site-packages (python 2.6)
# python -V
Python 2.7.14
大概,,问题应该是pip用了2.6的,和2.7的不通用导致的一个问题
试过pip install --upgrade pip也没有用
折腾了一下又出现一个新的错误
# pip install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip import main
ImportError: No module named pip
#
解决方案
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
mv /usr/bin/pip /usr/bin/pip.bak
ln -s /usr/local/bin/pip2.7 /usr/bin/pip
再次打印
# pip -V
pip 9.0.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
#
已经成功切换到了2.7版本的pip,测试,pip的各种使用问题成功解决
参考官网:https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py
页:
[1]