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

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

generic

解决方案

  1. 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()
  2. 70% 成功率 Use setuptools_scm to auto-include
    pip install setuptools_scm and configure accordingly

无效尝试

常见但无效的做法:

  1. Adding the file to the wrong directory 50% 失败

    Path mismatch.

  2. Using MANIFEST.in incorrectly 40% 失败

    May not include data files in wheel.