# ImportError: email-validator is not installed, run `pip install pydantic[email]`

- **ID:** `python/fastapi-attribute-error-email-validator`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A Pydantic model uses `EmailStr`, which requires the optional `email-validator` dependency.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   pip install 'pydantic[email]'
   ```
2. **** (97% success)
   ```
   echo 'pydantic[email]' >> requirements.txt && pip install -r requirements.txt
   ```

## Dead Ends

- **** — Loses email validation; invalid emails pass through to the DB. (70% fail)
- **** — Wrong package name; installs an unrelated module. (95% fail)
