Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
917 views
in Technique[技术] by (71.8m points)

python - Pip cannot find metadata file - EnvironmentError

Whenever I run pip to install the Flask packages like virtualenv in Ubuntu 16.04, I get this error:

pip install virtualenv

Requirement already satisfied: virtualenv in ./.local/lib/python3.5/site-packages (16.1.0) No metadata found in ./.local/lib/python3.5/site-packages Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/usr/.local/lib/python3.5/site-packages/virtualenv-16.1.0.dist-info/METADATA'

Here are my pip and python versions:

pip --version pip 19.0.1 from /usr/.local/lib/python3.5/site-packages/pip (python 3.5)

python3 --version Python 3.6.8

I already tried almost all that I get from the internet to solve this issue like:

/usr/.local/bin/pip install virtualenv

But I still get the same error.

I also go into the dist folder to copy the metadata.json with METADATA, but there's no metadata.json file inside.

cd /usr/.local/lib/python3.5/site-packages/virtualenv-16.1.0.dist-info/ cp metadata.json METADATA

cp: cannot stat 'metadata.json': No such file or directory

Please help me, I'm stucked with this issue for days. Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I meet the same problem

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/root/anaconda3/lib/python3.6/site-packages/tornado-6.0.4.dist-info/METADATA

then I cd /root/anaconda3/lib/python3.6/site-packages/tornado-6.0.4.dist-info/ && ls

DESCRIPTION.rst  LICENSE.txt  metadata.json

finally, I did cp metadata.json METADATA solved the problem. maybe this is helpful to you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...