# setup.cfg 中出错：命令 'install' 没有 'prefix' 选项

- **ID:** `python/setuptools-setup-cfg-invalid`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

在 setup.cfg 中为 install 命令指定了无效选项。

## 版本兼容性

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

## 解决方案

1. **Correct the option name in setup.cfg** (90% 成功率)
   ```
   Change 'prefix' to 'prefix=' or remove it if not needed
   ```
2. **Move options to setup.py** (80% 成功率)
   ```
   Use setup(..., options={'install': {'prefix': '/usr/local'}})
   ```

## 无效尝试

- **Ignoring the error and continuing** — Installation may fail later. (50% 失败率)
- **Removing the whole [install] section** — May lose necessary settings. (30% 失败率)
