Reputation: 131
How to get rid of this error when importing matplotlib (actually matplotlib.pyplot
)?
ImportError: DLL load failed while importing _cext: The specified module could not be found
These are fresh Python and Pycharm installs after reinstalling Windows 10. I am using Python 3.11.2 and Pycharm Community Edition 2022.3.3
I did not experience this issue before reinstalling Windows. Most likely I've been using older versions of Python and Pycharm but not much older (don't remember which exactly), something like six to eight months old.
Upvotes: 11
Views: 33423
Reputation: 51
Thanks to @deceze and @Keitetsu. This pip install msvc-runtime
works for me too. But there is one important thing about it: it must be installed in main python, not in a venv! (even if an error occurs in the venv) It takes me a long time to realize it, and I hope this will help someone else.
Upvotes: 1
Reputation: 101
If pip
installation of msvc-runtime
does not solve the problem, please check if the Microsoft Visual C++ Redistributable package is installed.
Upvotes: 10