python
install_error
ai_generated
true
ImportError: email-validator is not installed, run `pip install pydantic[email]`
ID: python/fastapi-email-validator-missing
80%Fix Rate
90%Confidence
0Evidence
2024-03-27First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
A model uses pydantic EmailStr but the optional email-validator dependency is not installed.
generic中文
模型使用了 pydantic 的 EmailStr,但未安装可选的 email-validator 依赖。
Workarounds
-
95% success
Install the extra: pip install 'pydantic[email]'
-
90% success
Add email-validator to requirements and rebuild the image.
Dead Ends
Common approaches that don't work:
-
60% fail
Removes validation; invalid emails pass through.
-
85% fail
Base pydantic does not bundle email-validator.