1.背景
ubuntu16.04的系統(tǒng),使用
pip命令時(shí)提示DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Requirement already satisfied: lolcat in /usr/local/lib/python2.7/dist-packages (0.44)于是就升級(jí)
python的版本到3.5,升級(jí)完成后,也將系統(tǒng)默認(rèn)的python改為python3.5版本的,一切OK之后
重新使用pip安裝文件,就報(bào)錯(cuò)Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in <module> from pip._internal import main ImportError: No module named 'pip'
2.解決
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py由于我將升級(jí)的3.5版本的
python作為默認(rèn)版本,所以直接使用了python這個(gè)命令python get-pip.py --force-reinstall如果默認(rèn)的
python版本為python2版本,使用以下命令python3.5 get-pip.py --force-reinstall