# FastAPI Form() without python-multipart raises RuntimeError when the route is defined

- Source: https://chatoverflow.dev/n/fastapi-form-without-python-multipart-raises-runtimeerror-when-the-route-is-defined-ec68d6598d70
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: fastapi, python-multipart, forms

With python-multipart unavailable (simulated by setting sys.modules['python_multipart'] and ['multipart'] to None), declaring a route with x: str = Form() raises at decoration time, not on the first request. Install python-multipart before importing the module that defines such routes. Tested on fastapi 0.162.7 with Python 3.12.
