-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matplotlib import issues - Could not load DLL #6689
Comments
I've narrowed this down specifically to: from import matplotlib import ft2font C:\WINDOWS\system32>python
|
Can you retry from the |
Appears to be the same: (C:\ProgramData\Anaconda3) C:\Users\DrCrook\Documents>python
|
I have the same error. However, using a simple "import matplotlib" does not cause such error
|
I mentioned this in another issue, but the culprit is the matplotlib.ft2font import. I tested importing each of the packages individually and the other four worked just fine. |
What's the output from
|
conda list
conda info
|
Nothing obviously wrong there. Did this originally work, but stopped after an update to something or an installation of something? |
It worked last week. I did conda update --all and my work may have pushed updates to my Windows machine over the weekend. This week I tried to debug some code and started getting the error. |
@CompPhysChris, what if you run
? Does that fix your problem? |
No, it's still giving the same error. |
Sorry, I just tried to reproduce in a win 7 VM, and things work OK for me. Here's what I did:
I suspected our freetype package, but I seem to have the same one as you:
My advice from #1672 (comment) is all I have to offer:
|
I didn't find the offending dll, but I was able to get it working again by uninstalling Anaconda and re-installing the latest download version. |
Hm, sorry that's what it took, but glad you got it working again. It seems like we might have issues updating from older versions. If anyone has more info, we'll be happy to look into it. |
If it helps anyone finding this issue. I had this issue on a new windows 10\python 3.6 install after installing a bunch of machine learning packages. Uninstalling cntk is what fixed the issue. |
For any packages that involve shared libraries, mixing |
I faced the same issue after I installed theano,keras and tensorflow in my system. However after restarting the command prompt and rerunning import matplotlib.pyplot, it worked fine. |
I had this issue after updating quite a few packages in conda using
|
I have the same issue but the dependency is different.|| Error:
I've tried:
My environment:
My Guess What is PyQt5? Would this be the issue? I'm lost on this one. I don't know how to trace dependencies for a DLL. I need a walkthrough / tutorial on how to trace a dependency. An interesting side-note. If I import the pyplot in Spyder no error but in the command terminal I get the above error. Why would that occur? |
Do you have miktex installed? Have you tried removing miktex from the Windows path? |
@behrangqwerty I took miktex out of the Windows path, uninstalled MikTex and TexStudio, then restarted. That worked. Thanks a million, I really appreciate it. |
I'm having this issue as well (Windows 7, 32bit). Here's the error log I'm getting:
I've tried un-/reinstalling conda, and updating to the latest version. Also tried specifically updating Matplotlib to the newest version (2.2.2). No dice. Going through the comment thread here, my next move would be to check my Windows DLLs for conflicting builds/dependencies (?). It seems like @behrangqwerty 's suggestion of uninstalling miktex worked for @carvetighter ... how did you figure out that was the problem? |
I read on some forum that the problem
might be connected to miktex. But this does not seem to have anything to do with your error. What I did to get rid of
was to uninstall matplotlib with |
The root issue with me was the update of matplotlib. I would stick with the conda install and deprecate matplotlib to an earlier version. |
Uninstalling with conda and installing with pip helped me too. |
So I have an interesting version of this issue. I have a python app that runs fine within spyder and even if I double-click the script and have pythonw.exe auto-launch it (its a gui app and I'm on windows). But, I get this same font_manager import error when I try to run this script by calling it from a 3rd party software (specifically: using jsl script in the JMP data analysis application, click here for a taste of what that looks like Any ideas on this? maybe a permissions thing? I only have one python environment: Anaconda3 |
OK I've figured something out. For me, ft2font was not importing because the program I was launching my python script from had a zlib.dll file of it's own and was inserting itself into my PATH so that the zlib.dll that existed in my Anaconda installation was not being chosen when interpreting the ft2font import. I forced my 3rd party program to remove itself from my path before launching my python script and boom, everything is working. So how can this help everyone else who's having this error in other situations? Well you need to figure out if you have some duplicates dlls, specifically zlib.dll and freetype.dll, and determine how to force your system to chose the right one during the ft2font import. Example on windows:
If any of these are not in the python environment directory you expect, then determine if you can adjust your PATH (for me, I'm using a temporary windows path adjustment on launch using the set PATH command), uninstall some other software, or just delete the dll if it's left over from something unnecessary. Hope this helps. |
I had the same problem as @jasonsross with
fixed the DLL import error. This is with https://matplotlib.org/users/installing.html#building-on-windows |
I had quite similar issues: weird error messages when importing matplotlib Found out that the Microsoft Cognitive Services Toolkit I had installed (2.0) was not compatible with the latest Anaconda version I had installed onto my Win 10 laptop today. After installing CSTK 2.5.1 the problem vanished.. |
Save me today. Also works for numpy, scipy... |
This solved it for me as well, thanks! |
Just use this command |
importing pandas before matplotlib takes care of this. |
Didn't help as well |
Doing following import solved the issue for me on Windows 10 |
Same issue on my machine (Win10 64-bit, Conda 4.7.12, Python 3.7.3.final.0) - Spent hours trying different methods found from GitHub/StackOverflow with no luck. Finally fixed the issue by downgrading to matplotlib 3.0.3 ("older stable version" as stated by the official website).
|
try conda conf --set channel priority strict and use conda-forge channel. That usually helps. |
for me the answer by janh in this post here solved the issue |
Traceback (most recent call last): Getting this error. Tried some of the solutions provided here, but no luck. Can anyone tell me what the problem is ? |
Can you provide more info? E.g.: conda info and conda list These things usually happen when you mix channels. |
Worked ! |
It never worked when i removed matplotlib and installing it, it worked after i removed python 3.8 and installing python 3.5 |
|
I've just had this problem with a new (and incompatible?) zlib.dll appearing in the path.
Thank you very much @jasonsross for the suggestion about looking for them ( |
I have no idea why, but it turned out this was it for me - I moved Miktek to after .../Anaconda3/Library/bin in the PATH (which I needed to add to fix a numpy import in Pycharm the first place) and this fixed the Qt5Agg use in matplotlib. Strange. None of these PATH machinations were necessary previously... |
Windows 10 machine w/Anaconda 5 and Python 3.6.
I deleted full old Anaconda folder and installed Anaconda on top of it. Possible this caused some issues and am willing to give a whirl at the "proper" uninstall method (couldn't find docs on that).
Until then, this is what I've got as an issue and am logging here. Please feel free to request any additional details.
Actual Error Trace:
ImportError Traceback (most recent call last)
in ()
2 import io
3 import scipy.misc as misc
----> 4 import matplotlib.pyplot as plt
5 get_ipython().magic('matplotlib inline')
6
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\pyplot.py in ()
27 from cycler import cycler
28 import matplotlib
---> 29 import matplotlib.colorbar
30 from matplotlib import style
31 from matplotlib import _pylab_helpers, interactive
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\colorbar.py in ()
34 import matplotlib.collections as collections
35 import matplotlib.colors as colors
---> 36 import matplotlib.contour as contour
37 import matplotlib.cm as cm
38 import matplotlib.gridspec as gridspec
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\contour.py in ()
19 import matplotlib.colors as colors
20 import matplotlib.collections as mcoll
---> 21 import matplotlib.font_manager as font_manager
22 import matplotlib.text as text
23 import matplotlib.cbook as cbook
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\font_manager.py in ()
56
57 import matplotlib
---> 58 from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
59 from matplotlib.compat import subprocess
60 from matplotlib.fontconfig_pattern import (
ImportError: DLL load failed: The specified procedure could not be found.
The text was updated successfully, but these errors were encountered: