【问题标题】:pipenv install giving Failed to load paths errorspipenv install 给出 Failed to load paths 错误
【发布时间】:2020-08-10 14:03:42
【问题描述】:

我正在运行pipenv install --dev,这给了我以下错误

Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (2df4c1)…
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file or directory

Output: 
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file or directory

Output: 
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file or directory

我真的不想更改命令,我宁愿解决根本问题,因为它是其他人正在使用的项目中 package.json 文件的一部分,而不是我只是想在我自己的机器上运行的东西..

谢谢

【问题讨论】:

    标签: python pipenv pipenv-install


    【解决方案1】:

    删除您的 Pipfile.lock 并尝试重新运行 pipenv install 以从您的 Pipfile 重建您的依赖项。它正在寻找一个不存在的虚拟环境。通过删除您的 Pipfile.lock,您可以强制 pipenv 创建一个新环境。

    【讨论】:

    【解决方案2】:

    我在我的 ubuntu 20.04 上发现了类似的错误:

    frog@ocean:playground/demo-selenium $ pipenv install selenium
    Installing selenium...
    ⠋ Installing...Failed to load paths: /bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/python: not found
    
    Output: 
    ⠙ Installing selenium...Failed to load paths: /bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/python: not found
    
    Output: 
    Failed to load paths: /bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/python: not found
    
    Output: 
    Error:  An error occurred while installing selenium!
    Error text: 
    /bin/sh: 1: /home/frog/.local/share/virtualenvs/demo-selenium-aj4lh7NL/bin/pip: not found
    
    ✘ Installation Failed 
    
    

    我的解决方法是: 当我运行pipenv shell 来创建一个新的虚拟环境时,只需添加选项--three--two 来指定python 版本。 这是因为我的 linux 没有安装 python 2。 然后我再次运行,我可以安装 selenium,finnaly。

    【讨论】:

      【解决方案3】:

      我跑了pipenv --python 3.7 然后pipenv shell --three

      它对我有用

      【讨论】:

        【解决方案4】:

        我在 Windows 中遇到了同样的错误,对我有用的是运行 pipenv --rm,然后运行 ​​pipenv check。然后我就可以顺利运行pipenv install

        【讨论】:

          猜你喜欢
          • 2020-12-10
          • 1970-01-01
          • 1970-01-01
          • 2016-10-24
          • 1970-01-01
          • 1970-01-01
          • 2017-09-24
          • 1970-01-01
          相关资源
          最近更新 更多