python config_error ai_generated true

ERROR: setuptools.errors.PackageNotFoundError: The 'data_files' pattern 'config/*.ini' did not match any files

ID: python/setuptools-extra-files-not-found

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.9 active
3.10 active

Root Cause

The specified glob pattern in setup.cfg or setup.py does not find any files in the package.

generic

中文

setup.cfg 或 setup.py 中指定的 glob 模式在包中未找到任何文件。

Workarounds

  1. 95% success Correct the path to the actual files
    Ensure the config directory exists and contains .ini files. Example: mkdir config; touch config/settings.ini
  2. 90% success Use package_data instead of data_files
    In setup.cfg: [options.package_data]
    * = config/*.ini

Dead Ends

Common approaches that don't work:

  1. Changing the pattern to '*.ini' without a directory 60% fail

    May match unintended files; also doesn't solve the path issue.

  2. Removing the data_files configuration entirely 80% fail

    Necessary files will be missing from the distribution.