【问题标题】:Poetry was not installed with the recommended installer. Cannot update automatically没有使用推荐的安装程序安装诗歌。无法自动更新
【发布时间】:2021-12-17 16:56:28
【问题描述】:

如何升级到最新版本?

规格:

  • Windows 10,
  • Visual Studio 代码,
  • 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│

如果还有什么我可以添加到帖子中的,请告诉我。

【问题讨论】:

  • 不要使用self:update,应该是poetry self update(带空格)。如果您使用他们的安装程序安装了诗歌,则此方法应该可以工作。
  • 嗯,好的。我现在有一个新错误。我已经更新了@Seon 的帖子

标签: python python-3.x bash python-poetry


【解决方案1】:

错误消息表明您可能已经使用 pip 安装了 poetry,它不支持自动 poetry 更新。您应该卸载当前安装的poetry 版本,然后使用the recommended method 重新安装它,它使用自定义安装脚本。

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

【讨论】:

  • 我确实使用pip 安装了它。我怎样才能卸载它?泰
  • pip uninstall poetry 好像能做到哈哈
  • poetry self update 有最新版本。谢谢你:)
猜你喜欢
  • 2022-12-31
  • 2011-01-15
  • 2022-08-06
  • 2022-11-13
  • 1970-01-01
  • 1970-01-01
  • 2020-07-22
  • 1970-01-01
  • 2020-05-05
相关资源
最近更新 更多