我是Python新手,第一次尝试安装一个项目依赖项,并运行提供的单元测试
该项目使用诗歌和pytest。我已成功地在Windows计算机上按照instructions on the website重新安装了poetry,但在尝试使用poetry install
安装依赖项时,出现以下错误:
EnvCommandError
Command C:\Users\jon.doe\AppData\Local\pypoetry\Cache\virtualenvs\my-project-d9FwOK5-py3.8\Scripts\python.exe - errored with the following return code 1, and output:
The system cannot find the path specified.
input was : import sys
if hasattr(sys, "real_prefix"):
print(sys.real_prefix)
elif hasattr(sys, "base_prefix"):
print(sys.base_prefix)
else:
print(sys.prefix)
at ~\.poetry\lib\poetry\utils\env.py:1101 in _run
1097│ output = subprocess.check_output(
1098│ cmd, stderr=subprocess.STDOUT, **kwargs
1099│ )
1100│ except CalledProcessError as e:
→ 1101│ raise EnvCommandError(e, input=input_)
1102│
1103│ return decode(output)
1104│
1105│ def execute(self, bin, *args, **kwargs):
C:\Users\jon.doe\AppData\Local\pypoetry
不存在,所以它找不到virtualenv。我的配置被设置为create a virtualenv if one doesn't exist(默认情况下,我没有做任何更改)
为什么它看起来在错误的地方,我如何让VirtualNV连接起来并运行这个项目
最终,诗歌不是问题所在。我的Windows副本附带了一个“python.exe”python安装程序,该安装程序有一个导致问题的环境变量——删除它修复了这个问题
相关问题 更多 >
编程相关推荐