# 错误：包数据文件 'mypackage/data/config.yaml' 未找到

- **ID:** `python/setuptools-package-data-missing`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

package_data 配置引用了源树中不存在的文件。

## 版本兼容性

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

## 解决方案

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

## 无效尝试

- **Creating an empty file with the same name** — The file may need specific content; an empty file may cause runtime errors. (70% 失败率)
- **Removing the package_data entry** — This may break functionality that depends on the file. (60% 失败率)
