1.背景
ubuntu16.04的系统,使用
pip
命令时提示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)
于是就升级
python
的版本到3.5,升级完成后,也将系统默认的python
改为python3.5
版本的,一切OK之后
重新使用pip安装文件,就报错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
由于我将升级的3.5版本的
python
作为默认版本,所以直接使用了python
这个命令python get-pip.py --force-reinstall
如果默认的
python
版本为python2
版本,使用以下命令python3.5 get-pip.py --force-reinstall