python config_error ai_generated true

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

ID: python/setuptools-entry-points-malformed

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2024-07-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

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

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 90% fail

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

  2. 60% fail

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