PIP无法导入名称' ssl_match_hostname'错误

发布于 2025-02-01 15:55:47 字数 309 浏览 3 评论 0原文

我的pip突然停止工作。我会收到以下错误:

追溯(最近的最新通话): Importerror:无法从部分初始化的模块'pip中导入名称“ ssl_match_hostname”。分析\ venv \ lib \ sit e-packages \ pip_vendor \ urllib3 \ packages_ init .py)

这是在虚拟环境中运行的,其他虚拟环境正常工作。我不太记得,但是我认为几天前我进行了PIP更新,此后还没有使用过。

有什么可以恢复使用PIP的解决方案吗?

My pip has suddenly stopped working. I get the following error:

Traceback (most recent call last):
ImportError: cannot import name 'ssl_match_hostname' from partially initialized module 'pip.vendor.urllib3.packages' (most likely due to a circular import) (c:\users\ed\onedrive\software dev\own projects\market analysis\venv\lib\sit
e-packages\pip_vendor\urllib3\packages_init
.py)

This is run within a virtual environment and other virtual environments are working fine. I can't quite remember but I think I did a pip update a few days ago and haven't used it since.

Are there any solutions to regain use of pip?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深爱不及久伴 2025-02-08 15:55:47

您可以尝试卸载然后重新安装PIP,这将清除任何(希望)破碎或损坏的任何东西。

You can try to uninstall and then reinstall pip, that would clear up anything (hopefully) broken or corrupted.

诗化ㄋ丶相逢 2025-02-08 15:55:47

强迫重新安装PIP对我有用。

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py --force-reinstall

参考: https://stackoverflow.com/a/a/a/678886408/4254808

Forced reinstallation of pip worked for me.

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py --force-reinstall

Ref: https://stackoverflow.com/a/67886408/4254808

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文