1

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?

machTucker
  • 55
  • 4

2 Answers2

0

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

Mr. Day
  • 73
  • 2
  • 7
  • 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? – machTucker May 27 '22 at 11:55
  • You can try to force uninstall it. – Mr. Day May 27 '22 at 12:22
0

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

kung_fu_coder
  • 146
  • 2
  • 3