# ImportError: cannot import name 'BaseModel' from 'pydantic'

- **ID:** `python/fastapi-import-error-pydantic`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Pydantic version is too old or not installed; BaseModel was introduced in v1.

## Version Compatibility

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

## Workarounds

1. **Upgrade pydantic to a recent version.** (95% success)
   ```
   pip install --upgrade pydantic
   ```
2. **If using pydantic v2, import from pydantic.v1.** (85% success)
   ```
   from pydantic.v1 import BaseModel
   ```

## Dead Ends

- **Installing an older version of pydantic that does not have BaseModel.** — BaseModel is a core feature; older versions may not have it. (70% fail)
- **Trying to import from pydantic.dataclasses instead.** — That is a different feature; BaseModel is the standard way. (60% fail)
