我正在通过 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/