python
config_error
ai_generated
true
错误:包数据文件 'data/config.yaml' 未找到
error: package data file 'data/config.yaml' not found
ID: python/setuptools-package-data-not-included
80%修复率
83%置信度
0证据数
2024-11-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
根因分析
包数据文件在源代码树中缺失,或未在 setup.py 中指定。
English
The package data file is missing from the source tree or not specified in setup.py.
解决方案
-
90% 成功率 Create the missing file or adjust setup.py
Ensure file exists and add include_package_data=True and package_data={'': ['data/*.yaml']} in setup() -
70% 成功率 Use setuptools_scm to auto-include
pip install setuptools_scm and configure accordingly
无效尝试
常见但无效的做法:
-
Adding the file to the wrong directory
50% 失败
Path mismatch.
-
Using MANIFEST.in incorrectly
40% 失败
May not include data files in wheel.