Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot import matplotlib with Python 3.7.x on Win10Pro #14322
Attempting to IMPORT matplotlib under Python 3.7.x on a Win10Pro results in error: "ImportError: DLL load failed: The specific module could not be found".
Code for reproduction
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Program Files\Python37\lib\site-packages\matplotlib\__init__.py", line 200, in <module> _check_versions() File "C:\Program Files\Python37\lib\site-packages\matplotlib\__init__.py", line 194, in _check_versions module = importlib.import_module(modname) File "C:\Program Files\Python37\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: DLL load failed: The specified module could not be found. >>> >>> # importing matplotlib works fine when PyQt5 imported first >>> import PyQt5 >>> import matplotlib >>> import serial >>> >>> ^Z
using matplotlib should not depend on importing PyQt5 first; but when done, code works fine
Python installed from Win installer
The offered solution to install 'Microsoft Visual C++ 2015 redistributable' is not helping me. I don't own it, and don't plan to buy it, as I am usually on Linux only.
If it is a kiwisolver issue, what should it provide that now comes from PyQt5? I notice that there is no folder kiwisolver, which is where I suppose any DLL file contributed by kiwis should reside?
Also, are you on Windows now or Linux, you mention both? Microsoft Visual C++ redist are free as far as I know: https://www.microsoft.com/en-us/download/details.aspx?id=48145
It is likely only a requirement on Windows, not linux. I've never encountered this on Linux.
See the discussion at the end of #14316
In very short summary:
I am going to close this in favor of #14303 (which I just marked as release critical for 3.1.1).
Thank you for reporting this @ullix !