2013年04月27日 星期六 20:58
刚学到《Python科学计算》第九章,9.1.2 用ivtk观察流水线
运行tvtk_ivtk_cone.py后,双击点开ConeSource对象后出现报错窗口:
vtkOutPutWindow:
ERROR: In ..\..\vtk-5.6.1\Filtering\vtkExecutive.cxx, line 377
vtkStreamingDemandDrivenPipeline (030A6290): Attempt to get input information vector from input port index 0 for algorithm vtkConeSource(03777330), which has 0 input ports.
ERROR: In ..\..\vtk-5.6.1\Filtering\vtkExecutive.cxx, line 377
vtkStreamingDemandDrivenPipeline (030A6290): Attempt to get input information vector from input port index 0 for algorithm vtkConeSource(03777330), which has 0 input ports.
ERROR: In ..\..\vtk-5.6.1\Filtering\vtkExecutive.cxx, line 377
vtkStreamingDemandDrivenPipeline (030A6290): Attempt to get input information vector from input port index 0 for algorithm vtkConeSource(03777330), which has 0 input ports.
ERROR: In ..\..\vtk-5.6.1\Filtering\vtkExecutive.cxx, line 377
vtkStreamingDemandDrivenPipeline (030A6290): Attempt to get input information vector from input port index 0 for algorithm vtkConeSource(03777330), which has 0 input ports.
修改属性编辑器中的内容后显示报错信息:
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\mayavi-3.4.1-py2.6-win32.egg\enthought\tvt
k\messenger.py", line 311, in send
_messenger.send(obj, event, *args, **kw_args)
File "C:\Python26\lib\site-packages\mayavi-3.4.1-py2.6-win32.egg\enthought\tvt
k\messenger.py", line 245, in send
for key in slots:
RuntimeError: dictionary changed size during iteration
不知道怎么解决这种报错,求帮助,谢谢
2013年04月28日 星期日 07:59
我想这应该是ivtk的BUG。我测试了一下最新版的Python(x, y),没有出现这个问题。在旧版本上出现了"RuntimeError: dictionary changed size during iteration"错误,但是没有出现第一个错误。
2013年04月28日 星期日 11:11
File "C:\Python26\lib\site-packages\mayavi-3.4.1-py2.6-win32.egg\enthought\tvtk\messenger.py", line 245, in send
for key in slots:
RuntimeError: dictionary changed size during iteration
看到line 245下面有删除字典元素的代码,我尝试将for key in slots:修改为for key in slots.keys():后没出现"RuntimeError: dictionary changed size during iteration"的错误。
但是还是有ERROR: In ..\..\vtk-5.6.1\Filtering\vtkExecutive.cxx, line 377
vtkStreamingDemandDrivenPipeline (030A6290): Attempt to get input information vector from input port index 0 for algorithm vtkConeSource(03777330), which has 0 input ports.
并且修改ConeSource属性时(修改的多边形边数),IPython抛出报错信息:
Exception occurred in traits notification handler.
Please check the log file for details.
Exception occurred in traits notification handler for object: vtkConeSource (01C
EA180)
Debug: Off
Modified Time: 28
Reference Count: 2
Registered Events:
Registered Observers:
vtkObserver (0419EA50)
Event: 33
EventName: ModifiedEvent
Command: 0419E9D0
Priority: 0
Tag: 1
Executive: 0392F480
ErrorCode: No error
Information: 01E3B080
AbortExecute: Off
Progress: 1
Progress Text: (None)
Resolution: 36
Height: 3
Radius: 1
Capping: On
Center: (0, 0, 0)
Direction: (1, 0, 0)
, trait: resolution, old value: 36, new value: 9
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\traits-3.6.0-py2.6-win32.egg\enthought\tra
its\trait_notifiers.py", line 374, in call_3
self.handler( object, old, new )
File "C:\Python26\lib\site-packages\mayavi-3.4.1-py2.6-win32.egg\enthought\tvt
k\tvtk_classes.zip\tvtk_classes\cone_source.py", line 109, in _resolution_change
d
self.resolution)
File "C:\Python26\lib\site-packages\mayavi-3.4.1-py2.6-win32.egg\enthought\tvt
k\tvtk_base.py", line 487, in _do_change
self._in_set += 1
TypeError: coercing to Unicode: need string or buffer, int found
这个不知道可以怎么改了。
2013年04月28日 星期日 11:31
我还是先换个新版本试试吧
------------------------
换了个2.7.3.1版本,没这个问题了…纠结了一天,不过通过查资料还是学到不少东西
另外,很喜欢若愚老师的《python科学计算》,爱不释手\(^o^)/~
Zeuux © 2024
京ICP备05028076号