【问题标题】:pip cannot import name 'ssl_match_hostname' errorpip cannot import name \'ssl_match_hostname\' error
【发布时间】:2022-12-28 07:53:25
【问题描述】:

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?

【问题讨论】:

    标签: python pip virtualenv


    【解决方案1】:

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

    【讨论】:

    • I have tried to uninstall pip from within the venv using "pip uninstall pip" and get the error above. anything to do with pip inside the venv gives this message unfortunately. Unless there is another way of uninstalling it?
    • You can try to force uninstall it.
    【解决方案2】:

    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

    【讨论】:

      猜你喜欢
      • 2022-12-28
      • 2019-01-06
      • 1970-01-01
      • 2020-11-30
      • 1970-01-01
      • 2015-08-12
      • 1970-01-01
      • 2014-05-10
      • 2018-10-02
      相关资源
      最近更新 更多