运行诗歌时更新 KeyError 'None'

问题描述 投票:0回答:1

我在运行此诗歌更新时遇到了问题。

KeyError

  'None'

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:199 in _propagate
      195│             # Iterate in reverse because conflict resolution tends to produce more
      196│             # general incompatibilities as time goes on. If we look at those first,
      197│             # we can derive stronger assignments sooner and more eagerly find
      198│             # conflicts.
    → 199│             for incompatibility in reversed(self._incompatibilities[package]):
      200│                 if incompatibility in self._contradicted_incompatibilities:
      201│                     continue
      202│
      203│                 result = self._propagate_incompatibility(incompatibility)

python --版本

Python 3.11.9

诗--版本

诗歌(1.8.3版)

知道如何解决这个问题

python python-3.x python-poetry
1个回答
0
投票

您可能出现此问题的原因已在您的第二行中指出:

at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:199 in _propagate
--------------------------------------------^^

看起来您没有使用为系统配置的 python 3.11.9,而是使用 python 3.10.x。

如果您正在完成项目,请确保执行以下操作:

  1. 启用 python 虚拟环境(导航到您的项目文件夹),然后:
    python -m venv <name of the virtual env>
    ->
    python -m venv .venv
  2. 完成后,请激活虚拟环境:
    source .venv/bin/activate
  3. 此后,执行
    poetry update
    。希望您的问题能够由此得到解决。
© www.soinside.com 2019 - 2024. All rights reserved.