8

我正在跑步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 文件的一部分,而不是我只是想在我自己的机器上运行的东西。

谢谢

4

4 回答 4

5

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

于 2020-09-06T01:10:57.207 回答
1

我在我的 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。

于 2021-04-10T03:57:08.947 回答
0

我在我的 Windows 中遇到了同样的错误,对我有用的是运行pipenv --rm,然后pipenv check. 然后我能够顺利运行pipenv install

于 2022-01-13T15:14:12.250 回答
0

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

它对我有用

于 2021-05-15T14:47:55.523 回答