Jump to solution
Verify

The Fix

pip install pydantic==2.11.8

Based on closed pydantic/pydantic issue #12189 · PR/commit linked

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -3,7 +3,10 @@ from ._migration import getattr_migration -from .version import VERSION +from .version import VERSION, _ensure_pydantic_core_version +
repro.py
pydantic version: 2.11.7 pydantic-core version: 2.33.2 pydantic-core build: profile=release pgo=false python version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] platform: Windows-10-10.0.19045-SP0 related packages: typing_extensions-4.14.1 commit: unknown
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install pydantic==2.11.8\nWhen NOT to use: This fix is not applicable if using a compatible version of `pydantic-core`.\n\n

Why This Fix Works in Production

  • Trigger: Exit code: 1. Output message:
  • Mechanism: Incompatible version of `pydantic-core` causes import errors in Pydantic
  • Why the fix works: Raises an error if an incompatible `pydantic-core` version is installed, addressing the issue where users encounter import errors due to version mismatches. (first fixed release: 2.11.8).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Incompatible version of `pydantic-core` causes import errors in Pydantic
  • Surfaces as: Exit code: 1. Output message:

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“I do think that it would be even better if pydantic would support all pydantic_core 2.xx.xx versions since pydantic_core seems to be using semantic versioning…”
@G0rocks · 2025-08-27 · confirmation · source
“> I have not confirmed but my suspicion is that my computer updates pydantic_core in the background and then that update breaks something”
@Viicos · 2025-08-27 · source
“I see, well that's life”
@G0rocks · 2025-08-27 · source
“> "yeah I'll update all your pip packages as well", didn't expect that but I do like having up to date stuff so I just…”
@Viicos · 2025-08-28 · source

Failure Signature (Search String)

  • Exit code: 1. Output message:

Error Message

Stack trace
error.txt
Error Message ------------- Exit code: 1. Output message: ------------------------------------------------------------------------------- <frozen runpy> 198 _run_module_as_main <frozen runpy> 88 _run_code __main__.py 4 <module> from copernicusmarine.command_line_interface.copernicus_marine import command_line_interface __init__.py 2 <module> from copernicusmarine.catalogue_parser.models import ( models.py 7 <module> from pydantic import BaseModel, ConfigDict __init__.py 435 __getattr__ module = import_module(module_name, package=package) __init__.py 126 import_module return _bootstrap._gcd_import(name[level:], package, level) main.py 36 <module> from ._internal import ( _decorators.py 18 <module> from ._core_utils import get_type_ref _core_utils.py 9 <module> from pydantic_core import validate_core_schema as _validate_core_schema ImportError: cannot import name 'validate_core_schema' from 'pydantic_core' (C:\Users\G0rocks\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pydantic_core\__init__.py)

Minimal Reproduction

repro.py
pydantic version: 2.11.7 pydantic-core version: 2.33.2 pydantic-core build: profile=release pgo=false python version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] platform: Windows-10-10.0.19045-SP0 related packages: typing_extensions-4.14.1 commit: unknown

Environment

  • Pydantic: 2

What Broke

Users experience import errors leading to application failures when using the toolbox.

Why It Broke

Incompatible version of `pydantic-core` causes import errors in Pydantic

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install pydantic==2.11.8

When NOT to use: This fix is not applicable if using a compatible version of `pydantic-core`.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/pydantic/pydantic/pull/12196

First fixed release: 2.11.8

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if using a compatible version of `pydantic-core`.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
  • Upgrade behind a canary and run integration tests against the canary before 100% rollout.

Version Compatibility Table

VersionStatus
2.11.8 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.