python data_error ai_generated true

warning: no previously-included files matching '*.pyc' found under directory '*' warning: no files found matching '*.json' under directory 'data'

ID: python/setuptools-manifest-in-missing-files

Also available as: JSON · Markdown · 中文
80%Fix Rate
82%Confidence
0Evidence
2024-10-11First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

Root Cause

MANIFEST.in references files or globs that do not exist in the source tree, so the sdist silently omits data files the package needs at runtime.

generic

中文

MANIFEST.in 引用了源码树中不存在的文件或通配符,导致 sdist 静默遗漏包运行时需要的数据文件。

Workarounds

  1. 90% success
    Verify paths exist relative to the project root and correct MANIFEST.in, e.g. `recursive-include src/pkg/data *.json`. Rebuild with `python -m build`.
  2. 85% success
    Prefer `[tool.setuptools.package-data]` in pyproject.toml to declare data files instead of relying on MANIFEST.in.

Dead Ends

Common approaches that don't work:

  1. 70% fail

    The resulting sdist lacks data files, causing runtime FileNotFoundError for users.

  2. 65% fail

    If the paths are wrong, additional globs produce more warnings without including files.