# ModuleNotFoundError: 没有名为 'uvicorn' 的模块

- **ID:** `python/starlette-no-module-named-uvicorn`
- **领域:** python
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

FastAPI/Starlette 不内置 ASGI 服务器；当前环境中未安装 uvicorn。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Install server extra:
pip install 'fastapi[standard]'  # or: pip install uvicorn
   ```
2. **** (85% 成功率)
   ```
   Verify the interpreter matches:
which python && python -m uvicorn --version
   ```

## 无效尝试

- **** — fastapi does not depend on uvicorn by default. (80% 失败率)
- **** — The module import still fails before any server starts. (85% 失败率)
