0

I have installed the 64bit Python environment (verified from console that it is 64 bit):

Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32

The error I am getting is when calling the line

import matplotlib.pyplot as plt

and the error is

ImportError: DLL load failed: %1 is no valid Win32-application.

Now the matploblib I installed was from a file named matplotlib-1.5.2-cp27-cp27m-win_amd64.whl and should be the 64bit version of the library. How can I narrow down what's going on here?

I downloaded the whl itself from http://www.lfd.uci.edu/~gohlke/pythonlibs/

Edit: The whole error message

    import matplotlib.pyplot as plt
  File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 114, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()

  File "C:\Python27\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "C:\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in <module>
    from matplotlib.externals.six.moves import tkinter as Tk
  File "C:\Python27\lib\site-packages\matplotlib\externals\six.py", line 199, in load_module
    mod = mod._resolve()
  File "C:\Python27\lib\site-packages\matplotlib\externals\six.py", line 113, in
 _resolve
    return _import_module(self.mod)
  File "C:\Python27\lib\site-packages\matplotlib\externals\six.py", line 80, in
_import_module
    __import__(name)
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 38, in <module>
    import FixTk
  File "C:\Python27\lib\lib-tk\FixTk.py", line 68, in <module>
    import _tkinter
ImportError: DLL load failed: %1 ist keine zulõssige Win32-Anwendung.
SinisterMJ
  • 3,425
  • 2
  • 33
  • 53
  • Maybe this will help? http://stackoverflow.com/questions/26638621/importerror-dll-load-failed-1-is-not-a-valid-win32-application-for-python-mat – Tom Pitts Sep 08 '16 at 12:29
  • I did check that SO question, but verified everything on there, so that should not be it. – SinisterMJ Sep 08 '16 at 12:31
  • From the complete error message (just added) it seems to point to _tkinter, but I checked the .pyd with DependencyWalker, and its 64bit – SinisterMJ Sep 08 '16 at 12:36
  • Possibly your 64 bit `matplotlib` is finding a 32 bit `_tkinter` somewhere else on your path. – strubbly Sep 08 '16 at 14:27
  • 1
    Interestingly enough, the two DLLs in my Python/DLLs were 32bit, no idea why, but that fixed it. – SinisterMJ Sep 09 '16 at 06:50

0 Answers0