python
install_error
ai_generated
true
ImportError: 未安装 email-validator,请运行 `pip install pydantic[email]`
ImportError: email-validator is not installed, run `pip install pydantic[email]`
ID: python/fastapi-email-validator-missing
80%修复率
90%置信度
0证据数
2024-03-27首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
模型使用了 pydantic 的 EmailStr,但未安装可选的 email-validator 依赖。
English
A model uses pydantic EmailStr but the optional email-validator dependency is not installed.
解决方案
-
95% 成功率
Install the extra: pip install 'pydantic[email]'
-
90% 成功率
Add email-validator to requirements and rebuild the image.
无效尝试
常见但无效的做法:
-
60% 失败
Removes validation; invalid emails pass through.
-
85% 失败
Base pydantic does not bundle email-validator.