# PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.0/migration/ for more details.

- **ID:** `python/fastapi-pydantic-v1-v2-mismatch`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Code written for Pydantic v1 imports BaseSettings from pydantic, but Pydantic v2 moved it to a separate package.

## Version Compatibility

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

## Workarounds

1. **** (93% success)
   ```
   pip install pydantic-settings; from pydantic_settings import BaseSettings
   ```
2. **** (85% success)
   ```
   Set model_config = SettingsConfigDict(env_file='.env') instead of class Config
   ```

## Dead Ends

- **** — FastAPI latest requires v2 features; downgrade cascades. (60% fail)
- **** — Import still fails at class definition time. (80% fail)
