# 错误：在平面布局中发现多个顶级包：['package1', 'package2']。

- **ID:** `python/setuptools-long-description-error`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

setuptools 自动发现包，但在同一目录中找到多个，导致歧义。

## 版本兼容性

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

## 解决方案

1. **Explicitly specify packages in setup.py or setup.cfg** (90% 成功率)
   ```
   In setup.cfg, add '[options]\npackages = find:' and configure find options, or list packages manually.
   ```
2. **Use a src-layout** (85% 成功率)
   ```
   Move packages into a 'src/' directory and set 'package_dir = {"": "src"}' in setup.cfg.
   ```

## 无效尝试

- **Ignoring the warning and proceeding** — setuptools may fail to build or include wrong packages. (80% 失败率)
- **Renaming the packages to have a common prefix** — This does not resolve the flat-layout detection logic. (60% 失败率)
