pip error: file urllib3-1.26.4.dist-info\METADATA does not exist

created at 02-15-2022 views: 5

problem

When I installed a python library today, I found an error every time:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'd:\\programdata\\anaconda3\\envs\\nlp\\lib\\site-packages\\urllib3-1.26. 4.dist-info\\METADATA'

It probably means that the METADATA file in the urllib3-1.26.4.dist-info directory does not exist.

Open the directory d:\\programdata\\anaconda3\\envs\\nlp\\lib\\site-packages\\urllib3-1.26.4.dist-info and take a look, and find that there is indeed no METADATA file:

no metadata file

Go back to the parent directory and find that there is another version of urllib3: urllib3-1.25.11.dist-info. And there is a METADATA file in this directory.

METADATA

So directly copy all files of urllib3-1.25.11.dist-info to urllib3-1.26.4.dist-info directory. Solved successfully.

Take a look at the METADATA file, the content is mainly about urllib3:

INFORMATION IN METADATA FILE

But I don't know why there is no METADATA file in this latest version... Maybe it was automatically deleted when pip upgrade failed before?

created at:02-15-2022
edited at: 02-15-2022: