1
我是64位os上的python2.7 64位,並安裝了matplotlib 64(matplotlib-1.5.1-cp27-none-win_amd64 .whl),但有這個進口錯誤:'matplotlib'ImportError:DLL加載失敗:%1不是有效的Win32應用程序
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.
任何想法?
如果您嘗試一個簡單的語句,是否會重現錯誤:'import tkinter'? – CristiFati
@CristiFati:這是我得到試圖'進口tkinter'時:'回溯(最近通話最後一個): 文件「」,1號線,在 導入錯誤:沒有模塊名爲tkinter' –
Betty
是的,是我不好我忘了下劃線:'import _tkinter'。 _ \ _ tkinter_是一個動態(_.pyd_)模塊(用C編寫)。它實際上是一個_.dll_,並且有其他dll作爲依賴關係。這種錯誤通常出現在找到某些依賴關係時(以文件名的形式),但它們沒有正確的內容(可能是該dll的另一個版本或其他體系結構)。 – CristiFati