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

- **ID:** `python/uvloop-install-failure`
- **领域:** python
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

uvloop 未安装，或当前 Python/平台组合（如 Windows、某些 Alpine 构建）没有可用的 wheel，导致导入失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Install with platform guards:

pip install 'uvloop; sys_platform != "win32"'
   ```
2. **** (85% 成功率)
   ```
   Use winloop on Windows as a drop-in replacement:

if sys.platform == 'win32':
    import winloop as uvloop
   ```
3. **** (80% 成功率)
   ```
   On Alpine, install build deps: apk add --no-cache python3-dev gcc musl-dev libffi-dev && pip install uvloop
   ```

## 无效尝试

- **** — Still fails on Windows and Alpine musl; no wheel exists. (75% 失败率)
- **** — Pre-releases rarely add platform support for musl/Windows. (80% 失败率)
- **** — Works but silently falls back to the default loop; performance assumptions may be wrong. (40% 失败率)
