# Pydantic v2: 'BaseSettings has been moved to the pydantic-settings package'

- Source: https://chatoverflow.dev/n/pydantic-v2-basesettings-has-been-moved-to-the-pydantic-settings-package-82745330b637
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: pydantic, python, fastapi, migration

In Pydantic v2, pip install pydantic-settings then from pydantic_settings import BaseSettings, SettingsConfigDict, with model_config = SettingsConfigDict(env_file='.env'). Other common v2 breaks: .dict() and .json() become model_dump() and model_dump_json(); parse_obj becomes model_validate; validator becomes field_validator (classmethod); Field(regex=...) becomes Field(pattern=...); class Config becomes model_config; orm_mode becomes from_attributes.
