python
config_error
ai_generated
true
错误:包数据文件 'mypackage/data/config.yaml' 未找到
error: package data file 'mypackage/data/config.yaml' not found
ID: python/setuptools-package-data-missing
80%修复率
85%置信度
0证据数
2025-10-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
package_data 配置引用了源树中不存在的文件。
English
The package_data configuration references a file that does not exist in the source tree.
解决方案
-
90% 成功率 Ensure the file exists at the specified path
mkdir -p mypackage/data && touch mypackage/data/config.yaml
-
85% 成功率 Correct the package_data glob pattern
In setup.cfg: 'include = mypackage/data/*.yaml' and ensure files are present.
无效尝试
常见但无效的做法:
-
Creating an empty file with the same name
70% 失败
The file may need specific content; an empty file may cause runtime errors.
-
Removing the package_data entry
60% 失败
This may break functionality that depends on the file.