python
install_error
ai_generated
true
RuntimeError: Form data requires "python-multipart" to be installed.
ID: python/fastapi-form-data-requires-python-multipart
80%Fix Rate
90%Confidence
0Evidence
2024-02-22First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 0.100.x | active | — | — | — |
| 0.110.x | active | — | — | — |
Root Cause
Using Form(...) or File(...) without the python-multipart package installed.
generic中文
使用Form(...)或File(...)但未安装python-multipart包。
Workarounds
-
99% success
pip install python-multipart
-
97% success
echo 'python-multipart>=0.0.9' >> requirements.txt
Dead Ends
Common approaches that don't work:
-
70% fail
If the client sends form-encoded data, FastAPI still needs multipart to parse it.
-
90% fail
Wrong package name; FastAPI imports python_multipart.