我尝试将matplotlib导入为plt,并以一个很长的错误结束:
ImportError: DLL load failed: %1 is not a valid Win32 application.
我的系统:pycharm,python3.4(64位)。 我安装了matplotlib(64bit)
我找不到六位64位专门。[这里] [1]只有一个选项:six-1.9.0-py2.py3-none-any.whl
由于
回溯:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\IPython\core\interactiveshell.py", line 3032, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-11-eff513f636fd>", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Python34\lib\site-packages\matplotlib\pyplot.py", line 109, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "C:\Python34\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Python34\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in <module>
from six.moves import tkinter as Tk
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Python34\lib\site-packages\six.py", line 90, in __get__
result = self._resolve()
File "C:\Python34\lib\site-packages\six.py", line 113, in _resolve
return _import_module(self.mod)
File "C:\Python34\lib\site-packages\six.py", line 80, in _import_module
__import__(name)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Python34\lib\tkinter\__init__.py", line 36, in <module>
from tkinter import _fix
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Python34\lib\tkinter\_fix.py", line 65, in <module>
import _tkinter
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: %1 is not a valid Win32 application.
发现问题。我使用的是32位解释器而不是64位(也已安装)