解决python升级导致pip无法使用

File "/usr/local/python3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
f(*args, **kwargs)
File "/usr/local/python3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/python3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 661, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/python3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 674, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/python3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 853, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==7.1.0' distribution was not found and is required by the application

 

先查看以下目录/usr/local/python最新版本/lib/python最新版本/site-packages查看对应的pip版本,然后修改pip,代码如下:

vi /usr/local/bin/pip

将pip==7.1.0修改成pip==对应版本,就可以了

上一篇:在sequence中千万不要用fork join_none


下一篇:pkg_resources.DistributionNotFound: The 'pytz' distribution was not found and is required