简体   繁体   English

Windows 中的诗歌安装不起作用

[英]Poetry installation in Windows doesn't work

Whenever I try to run poetry install on powershell inside a git repo, I keep getting this weird error, I really don't know what that might be.每当我尝试在 git 存储库中的 powershell 上运行poetry install时,我一直收到这个奇怪的错误,我真的不知道那可能是什么。 I am using Windows 10 and Python 3.10.0, when I try on Linux it runs normaly.我正在使用 Windows 10 和 Python 3.10.0,当我尝试 Linux 时,它运行正常。

Creating virtualenv manim-tx2tvM36-py3.10 in C:\Users\ricci\AppData\Local\pypoetry\Cache\virtualenvs
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

Package operations: 120 installs, 0 updates, 0 removals

  • Installing attrs (21.2.0)
  • Installing six (1.16.0)

  ValueError

  File \C:\Users\ricci\AppData\Local\pypoetry\Cache\artifacts\f9\2e\54\025dd026b70173a331f1335fa6d1329f5993b949c2f3d623bdda20bf1f\attrs-21.2.0-py2.py3-none-any.whl does not exist

  at ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│


  ValueError

  File \C:\Users\ricci\AppData\Local\pypoetry\Cache\artifacts\89\b2\f8\fd92b6d5daa0f8889429b2fc67ec21eedc5cae5d531ee2853828ced6c7\six-1.16.0-py2.py3-none-any.whl does not exist

  at ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│

How could I solve this error?我该如何解决这个错误? I already break my head trying to solve it, I did a lot of research, asked to some people, and nothing seems to work.我已经想办法解决它了,我做了很多研究,问了一些人,但似乎没有任何效果。

Try poetry update , that solved my issue.尝试poetry update ,这解决了我的问题。

As described in the question, the poetry install command was not working properly.如问题中所述, poetry install命令无法正常工作。 It was throwing an error: attrs-21.2.0-py2.py3-none-any.whl does not exist .它抛出了一个错误: attrs-21.2.0-py2.py3-none-any.whl does not exist I tried deleting the Poetry cache as recommended in this issue .我尝试按照本期的建议删除诗歌缓存。 I also tried downgrading my current Poetry installation and that didn't work either.我还尝试降级我当前的 Poetry 安装,但也没有用。 So as a last attempt, I downloaded install-poetry.py from the Poetry Github page, ran python install-poetry.py --preview and then, inside my repo, I ran poetry update and that worked.因此,作为最后一次尝试,我从 Poetry Github 页面下载了install-poetry.py ,运行了python install-poetry.py --preview ,然后,在我的仓库中,我运行了poetry update ,并且成功了。 I finally have Poetry installed.我终于安装了诗歌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM