python config_error ai_generated true

ValueError:EntryPoint.parse - 入口点生成文件中的入口点无效:'console_scripts = foo'

ValueError: EntryPoint.parse - invalid entry point in entry-points generated file: 'console_scripts = foo'

ID: python/setuptools-entry-points-malformed

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2024-07-12首次发现

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

pyproject.toml 或 setup.cfg 声明的入口点缺少必需的 'module:callable' 格式,例如 'foo = mypkg' 而非 'foo = mypkg.cli:main'。

English

A pyproject.toml or setup.cfg declares an entry point without the required 'module:callable' format, e.g. 'foo = mypkg' instead of 'foo = mypkg.cli:main'.

generic

解决方案

  1. 97% 成功率
    [project.scripts]
    foo = "mypkg.cli:main"
    # or for a module entry
    foo = "mypkg.cli:__main__"
  2. 90% 成功率
    python - <<'PY'
    from importlib.metadata import EntryPoint
    EntryPoint(name='foo', value='mypkg.cli:main', group='console_scripts')
    print('ok')
    PY

无效尝试

常见但无效的做法:

  1. 90% 失败

    An empty callable is still invalid; the parser requires a non-empty name after the colon.

  2. 60% 失败

    Breaks the CLI the project intends to expose and downstream scripts that call it.