pipenv安装失败,无法加载路径错误

2024-06-02 10:22:17 发布

您现在位置:Python中文网/ 问答频道 /正文

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

谢谢


Tags: tosharebinenvironmentmylocalshservice
3条回答

我在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创建新的虚拟环境时,只需向指定的python版本添加选项 three two。 这是因为我的linux没有安装python 2。 然后我再次运行,最后我可以安装selenium

我跑了pipenv python 3.7 然后pipenv shell three

它对我有用

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

相关问题 更多 >