# ImportError: 未安装 email-validator，请运行 `pip install pydantic[email]`

- **ID:** `python/fastapi-email-validator-missing`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

模型使用了 pydantic 的 EmailStr，但未安装可选的 email-validator 依赖。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Install the extra:
pip install 'pydantic[email]'
   ```
2. **** (90% 成功率)
   ```
   Add email-validator to requirements and rebuild the image.
   ```

## 无效尝试

- **** — Removes validation; invalid emails pass through. (60% 失败率)
- **** — Base pydantic does not bundle email-validator. (85% 失败率)
