ImportError: Entry point ('console_scripts', 'pip') not found on Mac

ImportError: Entry point ('console_scripts', 'pip') not found on Mac

收到消息

You are using pip version 8.0.2, however version 8.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

当我尝试通过 pip 安装包时。

我按照说明使用 pip install --upgrade pip 升级了 pip。现在我在使用 pip 时遇到错误,即使使用 pip --version 检查 pip 的版本也是如此。

  Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==8.0.2', 'console_scripts', 'pip')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2393, in load_entry_point
    raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'pip') not found

我在网上搜索并发现了一些类似的问题,例如 this, this and this。但是 none 的解决方案对我有用。

我想可能是我的 Mac 上有多个版本的 pip,我该如何清理它并安装最新版本?

谢谢。

手动删除了 /usr/local/bin/ 中的所有 pip 存储库。 (不确定是否有必要。)

然后按照说明重新安装 pip here

To install pip, securely download get-pip.py.

Then run the following:

python get-pip.py

仅供参考,easy-install pip 不起作用。