Could not install packages due to an EnvironmentEr

2020-01-28 08:55发布

I`ve recently started having problems with pip installs. Every time I run this kind of command in Terminal, I get an error:

Could not install packages due to:

EnvironmentError: [Errno 2] No such file or directory: '/'me'/'me'/anaconda3/lib/python3.6/site-packages/tqdm-4.11.2.dist-info/METADATA'

Does anyone know what's wrong? Didn't have this issue a month ago. Please help! Just in case: the error above popped up when i wrote pip install gender-guesser.

6条回答
冷血范
2楼-- · 2020-01-28 09:12

I use Pycharm. I have solved with problem with copy file METADATA from \AppData\Roaming\Python\Python37\site-packages\pip-19.0.1.dist-info\pip-19.0.1.dist-info to higher level \AppData\Roaming\Python\Python37\site-packages\pip-19.0.1.dist-info

查看更多
放荡不羁爱自由
3楼-- · 2020-01-28 09:12

I find the METADATA file in this path or this path subdirctory, then cp this file

查看更多
姐就是有狂的资本
4楼-- · 2020-01-28 09:18

Try to reinstall tqdm with conda. And then you can install packages with pip.

conda install tqdm

Wait until it done. Then you can do:

pip install gender-guesser
查看更多
啃猪蹄的小仙女
5楼-- · 2020-01-28 09:19

I faced the same problem.

Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/home/myusr/.local/lib/python3.6/site-packages/pip-19.0.1.dist-info/METADATA'

I followed the angrypig298 solution but it didn't work for me. The first part was ok.

conda install tqdm

But the second part got the same error of pip cannot find the METADATA file.

pip install gender-guesser

Based on other answers, I used the find command to find the METADATA in my machine and I found it in a subdirectory.

find ~/.local/ -name  "*METADATA*" | grep pip

The METADATA was in

/home/myuser/.local/lib/python3.6/site-packages/pip-19.0.1.dist-info/pip-19.0.1.dist-info/METADATA

I copy it to the path where the pip command is looking for it, which is one directory above it.

/home/myuser/.local/lib/python3.4/site-packages/pip-9.0.1.dist-info/METADATA

Then the pip worked normally.

查看更多
我只想做你的唯一
6楼-- · 2020-01-28 09:24

I met the same problem and this might work for you cd into the location where metadata.json exists and type this command cp metadata.json METADATA then you could do sudo pip install

查看更多
欢心
7楼-- · 2020-01-28 09:30

copy all the files in "/home/shuaizhang/.local/lib/python3.6/site-packages/pip-19.0.1.dist-info/pip-19.0.1.dist-info/" to the upper directory "/home/shuaizhang/.local/lib/python3.6/site-packages/pip-19.0.1.dist-info/"

Then, pip3 install --user --upgrade pip , solved my problem.

I hope this will help.

查看更多
登录 后发表回答