Could not install packages due to an EnvironmentError: [Errno 2]

前端 未结 6 1500
余生分开走
余生分开走 2020-12-01 17:24

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:

<
6条回答
  •  甜味超标
    2020-12-01 17:51

    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.

提交回复
热议问题