诗歌未使用建议的安装程序进行安装,因此无法自动更新。

7

如何升级到最新版本?

规格:

  • Windows 10,
  • Visual Studio Code,
  • Ubuntu Bash。

当前版本:

me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ python3 --version
Python 3.8.10

尝试更新 | poetry self update:

me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key/compositekey/tests$ poetry self update

  RuntimeError

  Poetry was not installed with the recommended installer. Cannot update automatically.

  at ~/.local/lib/python3.8/site-packages/poetry/console/commands/self/update.py:389 in _check_recommended_installation
      385         current = Path(__file__)
      386         try:
      387             current.relative_to(self.home)
      388         except ValueError:
     389             raise RuntimeError(
      390                 "Poetry was not installed with the recommended installer. "
      391                 "Cannot update automatically."
      392             )
      393

如果有其他需要添加的内容,请让我知道。


啊,好的。我现在有一个新错误。我已经更新了这篇文章 @Seon。 - StressedBoi69420
4个回答

10
错误消息表明您可能使用pip安装了poetry,而pip不支持自动更新poetry。您应该卸载当前安装的poetry版本,并使用推荐的方法重新安装,该方法使用自定义安装脚本。
在osx/linux上,您只需运行curl -sSL https://install.python-poetry.org | python3 -来下载并运行此安装脚本。

我用 pip 安装了它。现在该如何卸载它?谢谢! - StressedBoi69420
1
看起来 pip uninstall poetry 就可以了,哈哈。 - StressedBoi69420
poetry self update 已经是最新版本。谢谢 :) - StressedBoi69420

0

0
根据被接受的答案,你很可能是用pip安装了poetry。但如果你发现pip uninstall poetry返回一个警告说poetry未安装,那么另一种可能是你使用pipx安装了它。
运行pipx list将显示是否是这种情况。然后你可以运行pipx upgrade poetry,或者你可能想要卸载它并依赖于poetry来管理自己的安装/升级,因为现在这似乎相当稳固。
(我这样做是为了万一其他人,像我一样,安装了pipx来专门管理poetry安装,然后完全忘记了它,并找到了这个问题...!)

0
安装了推荐的方法后,仍然出现这个错误:
curl -sSL https://install.python-poetry.org | python3 -

...然后尝试用以下内容更新诗歌:
poetry self update

这并没有真正回答问题。如果你有其他问题,可以点击提问来提出。如果你想在这个问题有新的回答时收到通知,你可以关注此问题。一旦你拥有足够的声望,你还可以添加悬赏以吸引更多关注。- 来自评论 - Andrew Louw

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接