# RuntimeError: 表单数据需要安装 "python-multipart"。

- **ID:** `python/fastapi-form-data-missing-python-multipart`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

路由使用了 Form 或 File 参数，但环境中未安装 python-multipart 包。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 0.100+ | active | — | — |

## 解决方案

1. **** (98% 成功率)
   ```
   pip install python-multipart
   ```
2. **** (95% 成功率)
   ```
   echo 'python-multipart>=0.0.9' >> requirements.txt
pip install -r requirements.txt
   ```

## 无效尝试

- **** — Body expects JSON; form-encoded clients receive 422 errors. (80% 失败率)
- **** — There is no stdlib multipart parser; import fails. (90% 失败率)
