pip升级后,运行pip报错
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/pip/__main__.py", line 21, in <module>
from pip._internal.cli.main import main as _main
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
记录一下解决成功的方案(按网上的原因说的是版本升级得太高了):
# python2.7 => "Please use https://bootstrap.pypa.io/pip/2.7/get-pip.py instead"
# python3.x => "https://bootstrap.pypa.io/get-pip.py"
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
# python running file
python get-pip.py