Pip command not working

Whenever I try to do something, I get the following error:

File "C:\ProgramData\Anaconda2\envs\myenv\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ImportError: cannot import name 'DependencyWarning'

I know that this is a problem with the "requests" package (its version changed while working on something). The problem is, how do I update the "queries" when the pip does not work?

I work on windows in virtualenv.

+4
source share
1 answer

Got it to work after trying to hack into a solution that I read here (loans to Andrew Jong).

Go to the init .py file , causing an error. There will be a line -

from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning

Delete everything before urllib3, i.e. change it to -

from urllib3.exceptions import DependencyWarning

Now pip starts working again.

0
source

Source: https://habr.com/ru/post/1692786/


All Articles