tte*_*yco 22 python python-poetry
我正在通过 Poetry 管理 Python 项目中的依赖项。
\n现在我想在与我的开发机器不同的机器上运行这个项目。要安装依赖项,我只需从根目录运行以下命令:
\n$ poetry install\nRun Code Online (Sandbox Code Playgroud)\n但随后它会引发以下错误:
\nUpdating dependencies\nResolving dependencies...\n\nWriting lock file\n\nPackage operations: 70 installs, 0 updates, 0 removals\n\n \xe2\x80\xa2 Installing colorama (0.4.4)\n \xe2\x80\xa2 Installing tzdata (2021.1)\n\n ValueError\n\n 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\n\n at ~\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\poetry\\core\\packages\\file_dependency.py:40 in __init__\n 36\xe2\x94\x82 except FileNotFoundError:\n 37\xe2\x94\x82 raise ValueError("Directory {} does not exist".format(self._path))\n 38\xe2\x94\x82\n 39\xe2\x94\x82 if not self._full_path.exists():\n \xe2\x86\x92 40\xe2\x94\x82 raise ValueError("File {} does not exist".format(self._path))\n 41\xe2\x94\x82\n 42\xe2\x94\x82 if self._full_path.is_dir():\n 43\xe2\x94\x82 raise ValueError("{} is a directory, expected a file".format(self._path))\n 44\xe2\x94\x82\n\n\n ValueError\n\n File \\C:\\Users\\tteguayco\\AppData\\Local\\pypoetry\\Cache\\artifacts\\45\\2d\\cb\\6443e36999e7ab3926d5385dfac9ee9ea2a62f8111ff71abb6aff70674\\tzdata-2021.1-py2.py3-none-any.whl does not exist\n\n at ~\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\poetry\\core\\packages\\file_dependency.py:40 in __init__\n 36\xe2\x94\x82 except FileNotFoundError:\n 37\xe2\x94\x82 raise ValueError("Directory {} does not exist".format(self._path))\n 38\xe2\x94\x82\n 39\xe2\x94\x82 if not self._full_path.exists():\n \xe2\x86\x92 40\xe2\x94\x82 raise ValueError("File {} does not exist".format(self._path))\n 41\xe2\x94\x82\n 42\xe2\x94\x82 if self._full_path.is_dir():\n 43\xe2\x94\x82 raise ValueError("{} is a directory, expected a file".format(self._path))\n 44\xe2\x94\x82\nRun Code Online (Sandbox Code Playgroud)\n最好知道这些 *.whl 是什么以及 Poetry 如何使用它们。
\n小智 38
具体来说,我发现删除该AppData\Local\pypoetry\Cache\artifacts文件夹(我在 Windows 10 上)对我有用。其他项目的 virtualenvs 可能位于其中AppData\Local\pypoetry\Cache\virtualenvs,因此您可能不想AppData\Local\pypoetry\Cache完全删除根缓存文件夹。