5

I'm trying to install transformers with pip install transformers inside an Anaconda environment running TensorFlow 2.1.0 and I get the following error:

WARNING: No metadata found in c:\users\gamer\anaconda3\envs\tensorflow\lib\site-packages
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'c:\\users\\gamer\\anaconda3\\envs\\tensorflow\\lib\\site-packages\\chardet-3.0.4.dist-info\\METADATA'

There is a metadata.json file in that directory.

It also fails with the same error when installing other packages such as pip install tf-nightly.

I have tried enabling long paths as suggested in Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory \METADATA.

How do I solve this?

Ps.: installing transformers from anaconda transformers doesn't work for me, because it's using an old version (I mean, the installation works, but the version doesn't have what I need).

Rodrigo Ruiz
  • 4,248
  • 6
  • 43
  • 75
  • Does this answer your question? [Could not install packages due to an EnvironmentError: \[Errno 2\] No such file or directory \\METADATA](https://stackoverflow.com/questions/54778630/could-not-install-packages-due-to-an-environmenterror-errno-2-no-such-file-or) –  Feb 10 '20 at 20:47
  • 1
    Nope... that's the same URL I linked in the question. – Rodrigo Ruiz Feb 10 '20 at 20:50
  • Another one to look at [here](https://stackoverflow.com/q/54552367/10682164). I ran into this once with a different package and it seemed like there were a variety of causes and no clear answer that worked for everyone. My solution listed [here](https://stackoverflow.com/a/58082184/10682164). – totalhack Feb 10 '20 at 21:02

1 Answers1

5

I followed the mentioned directory in error, found a 'metadata.json' file, I made a copy of it without the '.json' extension and it worked.

Ibrahim
  • 61
  • 1
  • 4