Search code examples
pycharmpydantic

PyCharm Error no module named pydanticcore._pydantic_core


I have several scripts that suddenly stopped working - in fact ALL Python scripts no longer compile in PyCharm. One second they were running without issue and the next I get the error:

ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'

I tried reinstalling pydantic, pydanticcore, and I verified both were in the correct folder in Python. I added the modules to my requirements list, using pip show to verify the version:

pydantic==2.6.4
pydantic-core==2.16.3

No love.

I am running directly off my Windows laptop so there is no virtualization issue AND I have no clue why the entire IDE would suddenly crash.

I also rebooted, uninstalled and reinstalled pydantic and pydantic-core and I am NOT directly referencing or using them anywhere. .

I figured out how to go to the Interpreter and manually added in pydantic. Now it is asking for regex and regex_core (core I cannot find). Why did all of my modules suddenly vanish?

Has anybody ever experienced this before?


Solution

  • As it turns out, I had used PyCharm to directly install a missing module but I never installed that module in my host system. I had to go through all modules I added until I found the missing one. Once I had installed the missing module in the host system, everything worked great!