anybadge 失败并显示:无法从“anybadge.templates”导入名称“get_template”?

anybadge 失败并显示:无法从“anybadge.templates”导入名称“get_template”?

我想运行anybadge,但它失败并出现以下错误。为什么?

- apt-get update
- apt-get install --yes --no-install-recommends python3-pip
- pip3 install anybadge

用法:

anybadge --label='mylabel' --value='myvalue' --file='my.svg' --color=yellow

结果:

Traceback (most recent call last):
  File "/usr/local/bin/anybadge", line 5, in <module>
    from anybadge.cli import main
  File "/usr/local/lib/python3.10/dist-packages/anybadge/__init__.py", line 2, in <module>
    from .badge import Badge
  File "/usr/local/lib/python3.10/dist-packages/anybadge/badge.py", line 13, in <module>
    from .templates import get_template
ImportError: cannot import name 'get_template' from 'anybadge.templates' (unknown location)

答案1

已知问题,不知何故,anybadge 更新导致了该问题:https://github.com/jongracecox/anybadge/issues/63

相关内容