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%.
@@ -3,7 +3,10 @@
from ._migration import getattr_migration
-from .version import VERSION
+from .version import VERSION, _ensure_pydantic_core_version
+
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
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
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).
- 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
- GitHub issue: #12189
- Fix PR: https://github.com/pydantic/pydantic/pull/12196
- First fixed release: 2.11.8
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.41
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…”
“> I have not confirmed but my suspicion is that my computer updates pydantic_core in the background and then that update breaks something”
“I see, well that's life”
“> "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…”
Failure Signature (Search String)
- Exit code: 1. Output message:
Error Message
Stack trace
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
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
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.
When NOT to Use This Fix
- This fix is not applicable if using a compatible version of `pydantic-core`.
Verify Fix
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
| Version | Status |
|---|---|
| 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.