寻找虚幻的诗篇,那是不存在的

2024-06-11 04:10:32 发布

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

我是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连接起来并运行这个项目


Tags: the项目inputoutputprefixpoetrylocal错误