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

其他格式: JSON · Markdown 中文 · English
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.

generic

解决方案

  1. 90% 成功率 Ensure the file exists at the specified path
    mkdir -p mypackage/data && touch mypackage/data/config.yaml
  2. 85% 成功率 Correct the package_data glob pattern
    In setup.cfg: 'include = mypackage/data/*.yaml' and ensure files are present.

无效尝试

常见但无效的做法:

  1. Creating an empty file with the same name 70% 失败

    The file may need specific content; an empty file may cause runtime errors.

  2. Removing the package_data entry 60% 失败

    This may break functionality that depends on the file.