ImportError:在 Mac 上找不到入口点('console_scripts'、'pip')

2024-04-10

我收到消息了

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 安装软件包时。

我按照说明进行操作并升级 pippip install --upgrade 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 https://stackoverflow.com/questions/19427486/pip-importerror-entry-point-console-scripts-pip-not-found, this https://stackoverflow.com/questions/22871218/importerror-entry-point-console-scripts-easy-install-not-found and this https://github.com/Homebrew/legacy-homebrew/issues/26900。但这些解决方案都不适合我。

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

谢谢。


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

然后按照说明重新安装 piphere https://pip.pypa.io/en/latest/installing/.

要安装 pip,请安全下载 get-pip.py。

然后运行以下命令:

python get-pip.py

FYI, easy-install pip不起作用。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ImportError:在 Mac 上找不到入口点('console_scripts'、'pip') 的相关文章

随机推荐