python
module_error
ai_generated
true
ModuleNotFoundError: No module named 'uvicorn'
ID: python/starlette-no-module-named-uvicorn
80%Fix Rate
90%Confidence
0Evidence
2024-01-30First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
FastAPI/Starlette does not bundle an ASGI server; uvicorn was never installed in the active environment.
generic中文
FastAPI/Starlette 不内置 ASGI 服务器;当前环境中未安装 uvicorn。
Workarounds
-
95% success
Install server extra: pip install 'fastapi[standard]' # or: pip install uvicorn
-
85% success
Verify the interpreter matches: which python && python -m uvicorn --version
Dead Ends
Common approaches that don't work:
-
80% fail
fastapi does not depend on uvicorn by default.
-
85% fail
The module import still fails before any server starts.