# 错误：包目录 'mypackage/data' 不存在

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

## 根因

setup.py 或 setup.cfg 引用了源代码树中不存在的包数据目录。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   mkdir -p mypackage/data && touch mypackage/data/__init__.py
   ```
2. **** (90% 成功率)
   ```
   In setup.py, change include_package_data=True to a proper MANIFEST.in or package_data dict.
   ```

## 无效尝试

- **** — Empty directories are often ignored; the build may still fail if the directory is expected to contain files. (60% 失败率)
- **** — Removing it may exclude necessary data files from the distribution. (40% 失败率)
