python - “诗歌安装”命令失败;*.whl 文件未找到
问题描述
我正在通过 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
。
推荐阅读
- javascript - 无法访问数组中的对象 - Javascript
- angular - Angular,foreach 订阅
- c# - 将任务 C# Try-Catch 异常消息编写到 SQL 表中
- swift - 仅针对 SpriteKit 中的特定对象恢复原状
- c++ - 我的数独程序出现问题,出现一些错误代码
- time-series - ARIMA() error TypeError: __new__() got an unexpected keyword argument 'start'
- javascript - 如何从同一个输入框中获取多个输入并存储它们?
- node.js - 在 Callable Firebase Functions 中获取请求 URL
- android - 如何将 @Parcelize 与 createTypedArray(Creator) 一起使用?
- nestjs - Nest.js + Mikro-ORM:使用 createQueryBuilder 和 leftJoin 时未初始化的实体集合