# 警告：在目录 '*' 下未找到匹配 '*.pyc' 的先前排除文件
警告：在目录 'data' 下未找到匹配 '*.json' 的文件

- **ID:** `python/setuptools-manifest-in-missing-files`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   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% 成功率)
   ```
   Prefer `[tool.setuptools.package-data]` in pyproject.toml to declare data files instead of relying on MANIFEST.in.
   ```

## 无效尝试

- **** — The resulting sdist lacks data files, causing runtime FileNotFoundError for users. (70% 失败率)
- **** — If the paths are wrong, additional globs produce more warnings without including files. (65% 失败率)
