python - 'poetry install' 命令失败; *.whl 文件未找到

标签 python python-poetry

我正在通过 Poetry 管理 Python 项目中的依赖项。
现在我想在与我的开发机器不同的机器上运行这个项目。要安装依赖项,我只需从根目录运行此命令:

$ poetry install
但随后会引发以下错误:
Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 70 installs, 0 updates, 0 removals

  • Installing colorama (0.4.4)
  • Installing tzdata (2021.1)

  ValueError

  File \C:\Users\tteguayco\AppData\Local\pypoetry\Cache\artifacts\9e\b3\11\7d87ac44fdb2d557301f1f4086a37c080d1482a98751abe7cdbabbad26\colorama-0.4.4-py2.py3-none-any.whl does not exist

  at ~\AppData\Local\Programs\Python\Python39\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\tteguayco\AppData\Local\pypoetry\Cache\artifacts\45\2d\cb\6443e36999e7ab3926d5385dfac9ee9ea2a62f8111ff71abb6aff70674\tzdata-2021.1-py2.py3-none-any.whl does not exist

  at ~\AppData\Local\Programs\Python\Python39\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│
最好知道这些 *.whl 是什么以及 Poetry 如何使用它们。

最佳答案

具体我发现删除AppData\Local\pypoetry\Cache\artifacts文件夹(我在 Windows 10 上)为我工作。其他项目的 virtualenvs 可能在 AppData\Local\pypoetry\Cache\virtualenvs所以你可能不想删除 AppData\Local\pypoetry\Cache 处的根缓存文件夹整体而言。

关于python - 'poetry install' 命令失败; *.whl 文件未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69326748/

相关文章:

python - 诗歌管理python包CLI

python - pycharm 自动完成 "print()"而不是 "print"

python - 查询集在获取切片后无法重新排序查询

python - 将 __import__ 设置为 None 后,为什么我仍然可以导入?

python - 将 Psyco 与 Django 一起使用是否有意义?

python - 如何将 python sphinx-doc 移植到 github 页面?

python - 从 pip 转移到诗歌,现在 pytest-cov 不会收集覆盖率数据

python - 我使用诗歌创建了一个 Python 包,并将其发布到 PyPI,但 PyPI 中缺少我的包描述

python-packaging - 在不同的机器上使用诗歌

python - Jupyter 内核不使用 Poetry 环境