python config_error ai_generated true

error: Unknown distribution option: 'entry_points'

ID: python/setup-py-unknown-distutils-command

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active

Root Cause

Older setuptools versions do not support 'entry_points' in setup.py; should use 'entry_points' correctly.

generic

中文

较旧的setuptools版本不支持setup.py中的'entry_points';应正确使用'entry_points'。

Workarounds

  1. 95% success Upgrade setuptools and use correct syntax
    pip install --upgrade setuptools
    # In setup.py:
    entry_points={
        'console_scripts': ['mycommand=mymodule:main']
    }
  2. 90% success Use setup.cfg for entry points
    # setup.cfg
    [options.entry_points]
    console_scripts =
        mycommand = mymodule:main

Dead Ends

Common approaches that don't work:

  1. Renaming parameter to 'console_scripts' 70% fail

    The correct parameter is 'entry_points' with dict format; renaming breaks functionality.

  2. Removing entry_points entirely 60% fail

    Removes console scripts functionality, which may be needed.