'matplotlib'ImportError:DLL加载失败:%1不是有效的Win32应用程序

时间:2016-02-11 16:57:13

标签: python matplotlib

我是64位操作系统上的python2.7 64位,并安装了matplotlib 64(matplotlib-1.5.1-cp27-none-win_amd64.whl),但是有这个导入错误:

Traceback (most recent call last):
  File "sim.py", line 6, in <module>
    from Solution import *
  File "C:\Python27\My sim\Solution.py", line 6, in <module>
    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 65, in <module>
    import _tkinter
ImportError: DLL load failed: %1 nÆest pas une application Win32 valide.

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

有同样的问题。完全卸载了python和相关模块;删除C:\ Python27并重新重新安装。再次工作。我认为问题是旧版本之间存在冲突。