Poetry 未使用推荐的安装程序安装。无法自动更新

Str*_*420 8 python bash python-3.x python-poetry

如何升级到最新版本?

\n

规格:

\n
    \n
  • Windows 10,
  • \n
  • Visual Studio 代码,
  • \n
  • Ubuntu 狂欢。
  • \n
\n
\n

当前版本:

\n
me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ python3 --version\nPython 3.8.10\n
Run Code Online (Sandbox Code Playgroud)\n

尝试更新 | poetry self update:

\n
me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ poetry self update\n\n  RuntimeError\n\n  Poetry was not installed with the recommended installer. Cannot update automatically.\n\n  at ~/.local/lib/python3.8/site-packages/poetry/console/commands/self/update.py:389 in _check_recommended_installation\n      385\xe2\x94\x82         current = Path(__file__)\n      386\xe2\x94\x82         try:\n      387\xe2\x94\x82             current.relative_to(self.home)\n      388\xe2\x94\x82         except ValueError:\n    \xe2\x86\x92 389\xe2\x94\x82             raise RuntimeError(\n      390\xe2\x94\x82                 "Poetry was not installed with the recommended installer. "\n      391\xe2\x94\x82                 "Cannot update automatically."\n      392\xe2\x94\x82             )\n      393\xe2\x94\x82\n
Run Code Online (Sandbox Code Playgroud)\n

如果我可以在帖子中添加其他内容,请告诉我。

\n

Seo*_*eon 10

该错误消息表明您可能安装了poetrypip,它不支持自动poetry更新。您应该卸载poetry当前安装的版本,然后使用推荐的方法重新安装它,该方法使用自定义安装脚本。

在 osx/linux 上,您只需运行即可curl -sSL https://install.python-poetry.org | python3 -下载并运行此安装脚本。