Open indranilsinharoy opened 7 years ago
For what it's worth, I just duplicated this error under the following conditions:
OS: Windows 10 Python installation: Python 2.7 installed using Anaconda Mayavi package: mayavi 4.5.0 py27_0 VTK package: vtk 6.3.0 py27_1 PyQt package: pyqt 4.11.4 py27_4
If I downgrade using conda install mayavi=4.4
* the code works
Mayavi -> 4.4.0
VTK -> 5.10.1
*Unrelated note - this downgrades numpy from 1.10 to 1.9.3 which breaks Spyder, so you have to manually re-upgrade it
I have the same problem here. Nobody has a clue?
If still of any interest, with a similar configuration to Jeitan's, I just had the same error and quieted it by editing mayavi\modules\axes.py, in update_pipeline, changing: self.configure_input_data(self.axes, src.outputs[0]) to: self.configure_input_data(self.axes, src.outputs[0].output)
(Former is type PolyDataNormals, latter is PolyData, which derives from DataSet.)
I also encountered the issue.
@jdonegan Your suggestions fixed my problems:+1: . I reckon you should post a fix so that it does not have to be done manually
I was also having this issue and the fix from @jdonegan worked well. Was going to submit a PR but looks like @prabhuramachandran has already pushed a commit that fixes this, by instead replacing the line in question with: self.configure_input(self.axes, src.outputs[0])
Perhaps this issue should be closed to prevent confusion?
Similarly, the same issue and similar fix should be applied to line 373 in decorations.py: axes.axes.ranges = \ axes.module_manager.source.outputs[0].output.bounds
to solve for the error "AttributeError: 'PolyDataNormals' object has no attribute 'bounds'"
So I believe the commit 996fb25 only fixed part of the problem.
As @TinghuiWang noted, this needs to be fixed in multiple places. However, depending on your plot call (for me it was plot3d vs points3d), you may need to change it back. I fixed it as follows:
In mayavi\modules\axes.py
at line 173, I changed
self.configure_input_data(self.axes, src.outputs[0])
to
data = src.outputs[0] if not hasattr(src.outputs[0], 'output') else src.outputs[0].output
self.configure_input_data(self.axes, data)
Similarly in \mayavi\tools\decorations.py
at line 372 I canged
axes.axes.ranges = axes.module_manager.source.outputs[0].bounds
to
src = axes.module_manager.source
data = src.outputs[0] if not hasattr(src.outputs[0], 'output') else src.outputs[0].output
axes.axes.ranges = data.bounds
Please fix it guys. The axes are really needed.
Follows above method, I only solved part of the problem, I still have the exception:
Exception occurred in traits notification handler for object: <mayavi.tools.decorations.Axes object at 0x11a41ce60>, trait: extent, old value: [0 0 0 0 0 0], new value: [ -2. 17. -2. 17. -4.85316642 6.54683358] NoneType: None
and no axes label on the image.
Anyone can help? Thanks!
Hi, recently, I updated Mayavi from 4.4.4 to 4.5.0. Following the update, I am observing an exception when I use the
mlab
functionaxes()
. Here is a test code (the line causing error is indicated by the comment):When the run the above code in Windows and anaconda environment, I see the following error messages:
Pop-up message (box):
Message in console window:
Extra information
Environment in which the above exception occurs OS: Windows 10 Python installation: Python 2.7 installed using Anaconda Mayavi package: mayavi 4.5.0 py27_0 menpo VTK package: vtk 7.0.0 py27_0 menpo PyQt package: pyqt 5.6.0 py27_1
Environment in which the above code runs OK OS: Windows 7 Python installation: Python 2.7 installed using Anaconda Mayavi package: mayavi 4.4.4 py27_0 menpo VTK package: vtk 7.0.0 py27_0 menpo PyQt package: pyqt 4.11.4 py27_5