{"id":"a20d4ffe-8e3c-427d-b888-4bcf30cb4986","slug":"pydantic-pydantic-errors-pydanticimporterror-basesettings-has-been-7e99","url":"https://api.modalhub.ai/r/pydantic-pydantic-errors-pydanticimporterror-basesettings-has-been-7e99","urls":{"html":"https://api.modalhub.ai/r/pydantic-pydantic-errors-pydanticimporterror-basesettings-has-been-7e99","md":"https://api.modalhub.ai/r/pydantic-pydantic-errors-pydanticimporterror-basesettings-has-been-7e99.md","json":"https://api.modalhub.ai/r/pydantic-pydantic-errors-pydanticimporterror-basesettings-has-been-7e99.json","history":"https://api.modalhub.ai/r/pydantic-pydantic-errors-pydanticimporterror-basesettings-has-been-7e99/history"},"symptom":"pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package.","command":null,"exit_code":null,"tool":"pydantic","version":"2.0","os":null,"date":"2026-10-28","cause":"Pydantic 2 split settings management out of the core library into the separate pydantic-settings distribution; the old import path is now a stub that raises","risk":{"level":"caution","flags":[{"code":"installs_package","args":["pypi:pydantic-settings"]}],"v":1},"fix":{"type":"command","body":"python -m pip install pydantic-settings\n# then: from pydantic_settings import BaseSettings, SettingsConfigDict\n# and replace class Config with model_config = SettingsConfigDict(env_prefix=\"APP_\")"},"repro":"python -c \"from pydantic import BaseSettings\"","check":"python -c \"from pydantic_settings import BaseSettings\"","notes":"The printed line goes on to link the migration guide. class Config still works on pydantic-settings but warns (PydanticDeprecatedSince20). Verified on pydantic 2.14 with pydantic-settings 2.16.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[]},"arms":[{"range":"2.0","status":"works"}],"dead_ends":[{"attempt":"install pydantic-settings but keep 'from pydantic import BaseSettings'","why":"pydantic's stub raises PydanticImportError for that path whatever is installed; the import itself must change to pydantic_settings","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-10-28T18:26:48.45483Z","updated_at":"2026-10-28T18:26:48.45483Z","last_confirmed_at":null,"ledger":{"first_seq":87,"last_seq":87,"head_hash":"8aabd3469bd9102df0593a0d3a5275f2c3071f995f13fccd83bb249d1e065b1b"}}
