python
install_error
ai_generated
true
RuntimeError: 表单数据需要安装 "python-multipart"。
RuntimeError: Form data requires "python-multipart" to be installed.
ID: python/fastapi-form-data-missing-python-multipart
80%修复率
90%置信度
0证据数
2024-03-22首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 0.100+ | active | — | — | — |
根因分析
路由使用了 Form 或 File 参数,但环境中未安装 python-multipart 包。
English
A route used Form or File parameters but the python-multipart package was not installed in the environment.
解决方案
-
98% 成功率
pip install python-multipart
-
95% 成功率
echo 'python-multipart>=0.0.9' >> requirements.txt pip install -r requirements.txt
无效尝试
常见但无效的做法:
-
80% 失败
Body expects JSON; form-encoded clients receive 422 errors.
-
90% 失败
There is no stdlib multipart parser; import fails.