Pip cannot find metadata file - EnvironmentError

后端 未结 6 1977
感情败类
感情败类 2020-12-11 18:59

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

pip install virtualenv

6条回答
  •  执笔经年
    2020-12-11 19:31

    I just ran into this with a different package, using Python 3.6.5 and pip 19.2.3. I was hesitant to use the solutions here (and on similar SO questions) so I just tried the following and it cleared up the issue:

    pip install --force-reinstall package_with_metadata_issue

    Note that my case was complaining about the black package, which was a dependency of something else I was trying to install (with a simple pip install other_package). Black had already been installed and working on my system for a while, so it's unclear how it got into a bad state or what changed in pip such that it couldn't handle the package's state.

    To be specific, the OP could try:

    pip install --force-reinstall virtualenv

    Though it seems like many other people here had an issue with pip itself, so that may just be kicking the can down the road until pip is in a good state.

提交回复
热议问题