python
install_error
ai_generated
true
AssertionError: 必须安装 `python-multipart` 库才能使用表单解析。
AssertionError: The `python-multipart` library must be installed to use form parsing.
ID: python/starlette-form-data-missing-python-multipart
80%修复率
90%置信度
0证据数
2024-06-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
FastAPI/Starlette 的表单处理需要 python-multipart,但该库未安装。
English
FastAPI/Starlette form handling requires python-multipart, which is not installed.
解决方案
-
98% 成功率
pip install python-multipart
-
95% 成功率
echo 'python-multipart>=0.0.9' >> requirements.txt
无效尝试
常见但无效的做法:
-
85% 失败
Form submissions are not JSON; parsing fails with a different error.
-
90% 失败
The assertion fires before the handler runs.