找不到'pip == 9.0.1'分布,并且是应用程序所必需的

时间:2017-04-09 20:24:29

标签: python pip

当我尝试安装Jupiter时,我收到错误:

┌─╼ [~]
└────╼ sudo -H pip install jupyter
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/dist-packages/pkg_resources/__init__.py", line 3036, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 656, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 669, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 854, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application

在这里,当我执行命令pip --version时,我得到了

pip 9.0.1 from /home/jeremie/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (python 2.7)

我该怎么做才能解决这个问题?

提前致谢!

P.S。我正在运行Ubuntu 16.10。

1 个答案:

答案 0 :(得分:3)

sudo -H pip是系统点

  

文件&#34; / usr / local / bin / pip&#34;,

pip --version是您当地路径上的点子

  来自/home/jeremie/Enthought/Canopy_64bit/User/lib/python2.7/site-packages(python 2.7)

9.0.1

不要使用sudo