Enthought Mayavi嵌入了wx问题

时间:2013-04-22 14:26:48

标签: python python-2.7 wxpython enthought mayavi

首先是我的跑步系统:

我在存储库中使用Windows 8 Pro和Mayavi 4.3以及在Python 2.7.4中使用wxPython 2.9.4.0,但是EPD包中的mayavi 4.2.1也存在同样的问题......

当我尝试将mayavi嵌入笔记本电脑面板时,我遇到了一些UI问题。即使在mayavi的演示文件中,我也得到了mayavi生成的外部帧的奇怪行为。

因此,使用设置按钮将打开设置窗口。此外,场景对使用设置更改的参数做出反应。但单击确定或临时后窗口不会关闭。并且python返回了几条错误消息。当我通过实现mlab.show_pipeline()命令使用管道时,出现了类似的行为。

这种行为也可以在sample from the enthought web page找到。

在尝试在enthougth示例的设置框架中单击“确定”后,您可以看到我的错误消息:

C:\my_directory\>python wx_embedding.py
C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\wx\toolkit.py:35: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
 _app = wx.PySimpleApp()

wx_embedding.py:63: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
app = wx.PySimpleApp()

Traceback (most recent call last): File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\wx\ui_live.py", line 360, in _on_ok
self.close( wx.ID_OK )

File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\wx\ui_live.py", line 320, in close

ui.finish()
File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\ui.py", line 264, in finish

self.reset( destroy = True )
File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\ui.py", line 304, in reset
editor.dispose()
File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\wx\instance_editor.py", line 208, in dispose
self._ui.dispose()

File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\ui.py", line 237, in dispose
self.finish()
File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\ui.py", line 264, in finish
self.reset( destroy = True )

File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\ui.py", line 318, in reset
toolkit().destroy_children( self.control )
File "C:\Python27\lib\site-packages\enthougth_development_mayavi_git\traitsui\traitsui\wx\toolkit.py", line 474, in destroy_children
control.DestroyChildren()

File "C:\Python27\lib\site-packages\wx-2.9.4-msw\wx\_core.py", line 9203, in DestroyChildren
return _core_.Window_DestroyChildren(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "GetEventHandler() == this" failed at .    .\..\src\common\wincmn.cpp(468) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed

提前致谢

2 个答案:

答案 0 :(得分:1)

Mayvi与wx 2.9不兼容。

此处有更多信息:https://support.enthought.com/entries/22601196-wxPython

请使用enpkg恢复为EPD附带的wx 2.8。

答案 1 :(得分:1)

至少可以通过与此PR关联的更改来解决此特定异常:https://github.com/enthought/traitsui/pull/108。我还不知道Mayavi和其余的堆栈,但是这个改变至少会让traitsui使用wxPython 2.9。