找不到'pip == 9.0.3'发行版,应用程序需要此发行版

时间:2019-02-06 12:36:03

标签: pip

我的笔记本电脑中装有最新版本的pip。使用pip安装任何模块时,总是会出现此错误。

Traceback (most recent call last):
 File "/usr/local/bin/pip", line 6, in <module>
    from pkg_resources import load_entry_point
 File "/usr/local/lib/python2.7/site- 
    packages/pkg_resources/__init__.py", line 3195, in <module>
    @_call_aside
File "/usr/local/lib/python2.7/site- 
    packages/pkg_resources/__init__.py", line 3179, in _call_aside
   (*args, **kwargs)
File "/usr/local/lib/python2.7/site-p 
    packages/pkg_resources/__init__.py", line 3208, in _ 
    initialize_master_working_set
    working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/site- 
    packages/pkg_resources/__init__.py", line 681, in _build_master
    ws.require(__requires__)
File "/usr/local/lib/python2.7/site- 
   packages/pkg_resources/__init__.py", line 999, in require
   needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/site- 
   packages/pkg_resources/__init__.py", line 885, in resolve
   raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.3' distribution was not found and is required by the application

我该如何解决此问题

1 个答案:

答案 0 :(得分:0)

验证您拥有/usr/bin/pip并且可以使用。

/usr/bin/pip --version
/usr/bin/pip install …

然后删除/usr/local/bin/pip并进行bash重新哈希$PATHhash -r