我在Mac上的Eclipse中工作。我正在使用PyDev 2.6.0.2012062818版本。我更新了我的獅子操作系統山獅操作系統我有一個完美運行的程序,但之後,我有以下錯誤運行時:AttributeError:'模塊'對象沒有屬性'VERSION_STRING'
Traceback (most recent call last):
File "/Users/Mihails/Projects/memsim/src/memsim/memsim.py", line 7, in <module>
from simulation import SimulationHP
File "/Users/Mihails/Projects/memsim/src/memsim/simulation.py", line 9, in <module>
import matplotlib.pyplot as plt
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/pyplot.py", line 95, in <module>
new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
globals(),locals(),[backend_name])
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/backend_wxagg.py", line 23, in <module>
import backend_wx # already uses wxversion.ensureMinimal('2.8')
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/backend_wx.py", line 63, in <module>
backend_version = wx.VERSION_STRING
AttributeError: 'module' object has no attribute 'VERSION_STRING'
我不明白WX模塊在所有。我在站點包中沒有wx文件夾。我有wxPython。 wxPython的init.py文件:
# The "old" wxPython package
import warnings
warnings.warn(
"The wxPython compatibility package is no longer automatically generated "
"or actively maintained. Please switch to the wx package as soon as possible.",
DeprecationWarning, stacklevel=2)
# We need to be able to import from the wx package, but there is also
# a wxPython.wx module and that would normally be chosen first by
# import statements. So instead we'll have a wxPython._wx module and
# then stuff it into sys.modules with a wxPython.wx alias so old
# programs will still work.
import _wx
import sys
sys.modules['wxPython.wx'] = _wx
wx = _wx
del sys
from wx import __version__
哪一個是主要的wx文件? – user1513100 2012-08-13 09:24:38
print wx .__ path__。並在此文件中附加'VERSION_STRING'變量。在Linux主WX文件中是'/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/',但文件是__version__.py。也許給你這個文件的來源? – Zerstoren 2012-08-13 09:26:59
AttributeError:'模塊'對象沒有屬性'__path__'。我想整個wx都有問題。順便說一句,wx和wxPython一樣嗎? – user1513100 2012-08-13 09:28:26