ContinuumIO / anaconda-issues

Anaconda issue tracking
647 stars 221 forks source link

Matplotlib 1.5.1 broken on Windows 10 #689

Open kalefranz opened 8 years ago

kalefranz commented 8 years ago

From @nihalarju on March 8, 2016 19:0

With Anaconda, trying to import matplotlib.pyplot leads to error:

Traceback (most recent call last): File "", line 1, in File "C:\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 36, in from matplotlib.figure import Figure, figaspect File "C:\Anaconda3\lib\site-packages\matplotlib\figure.py", line 35, in from matplotlib import _image File "C:\Anaconda3\lib\site-packages\matplotlib_image.py", line 7, in bootstrap() File "C:\Anaconda3\lib\site-packages\matplotlib_image.py", line 6, in bootstrap imp.load_dynamic(name,file) File "C:\Anaconda3\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found.

Version and system info: Python 3.5.1 |Anaconda 2.5.0 (64-bit)| [MSC v.1900 64 bit (AMD64)] on win32

Tried:

conda update conda
conda update --all

with no effect.

Thanks for looking into this.

Copied from original issue: conda/conda#2204

msarahan commented 8 years ago

You probably have some other library getting in the way earlier on PATH. The easiest way to avoid this is to create an environment. Activating an environment puts the correct entries on PATH first. If this still doesn't work, then there are bad libraries in Windows\System32. Qt libraries, for example, do not belong there.

nihalarju commented 8 years ago

Creating a virtual environment helped, but my PATH has Anaconda at the top. Shouldn't that work?

PATH = C:\Anaconda3;C:\Anaconda3\Scripts;C:\Anaconda3\Library\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32; ...

msarahan commented 8 years ago

If creating a conda environment helped, then having Anaconda at the front of PATH should also work. Is it always at the front of PATH, or only after activation?

nihalarju commented 8 years ago

It is always at the front in my system!

msarahan commented 8 years ago

OK, I can't explain why an environment works any better. You might be able to figure out which DLLs are misbehaving using http://www.dependencywalker.com/ - you should be able to load any of matplotlib's pyd files and take a look at which dependencies may not be getting loaded correctly.

Note that DLLs in Windows\System32 are found before anything on PATH, so having 3rd party stuff installed there can break many things: https://msdn.microsoft.com/en-us/library/7d83bc18.aspx

nihalarju commented 8 years ago

Thanks for the tips. I'll follow up on these suggestions. At least I can some work done now. I appreciate your help.

mcg1969 commented 8 years ago

I'm unable to reproduce this error. However, Dependency Walker is telling me that the _image extension can't find API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL and several DLLs with the prefix API-MS-WIN-CORE-WINRT. That said, I'm able to import matplotlib.pyplot without issue, and import matplotlib._image as well.

insertinterestingnamehere commented 8 years ago

Dependency Walker usually shows a several erroneous dlls as "not found". On my machine I see a bunch of dlls starting with "API-MS-WIN" and "EXT-MS-WIN" for numpy.core.multiarray, but everything works fine anyway.

mcg1969 commented 8 years ago

Indeed. Though it did help us track down another issue, so it was worth a shot!

insertinterestingnamehere commented 8 years ago

Oh yes, it's extremely useful. I'm just saying that not all of the errors it shows are actually correct.