Open moorepants opened 10 years ago
This example works with the wxpython backend.
This issue recently resurfaced with our CI builds that have been stable for months. In the last ~24 hours they started giving this same error. Did something change with packaging at the conda
end in terms of which Qt backend gets pulled in with traits
, or was a package updated?
@ccordoba12 @ilanschnell May be related to the qt/pyqt changes of late?
It could. @moorepants, could you try again? It should be fixed now :-)
It looks like our CI builds are passing again, thanks!
Does somebody mind explaining how/why this issue came up? And perhaps how it was fixed?
I'm having a similar issue with conda 4.2.9. Using a package (pysurfer) that uses Mayavai with the qt backend, I get the error:
NotImplementedError: the tvtk.pyface.ui.null. pyface backend doesn't implement SceneEditor
Would downgrading to prior to when said "qt/pyqt changes of late" changes were made fix the issue? Or is there a nightly build of anaconda available?
I just updated all of my conda packages with:
moorepants@garuda:~$ conda list mayavi
# packages in environment at /home/moorepants/miniconda3:
#
mayavi 4.5.0 np112py35_2 conda-forge
moorepants@garuda:~$ conda list vtk
# packages in environment at /home/moorepants/miniconda3:
#
vtk 7.1.1 py35_202 conda-forge
moorepants@garuda:~$ conda list pyqt
# packages in environment at /home/moorepants/miniconda3:
#
pyqt 4.11.4 py35_2 conda-forge
moorepants@garuda:~$ conda list pyface
# packages in environment at /home/moorepants/miniconda3:
#
pyface 5.1.0 py35_1 conda-forge
The example mentioned in the opening of this issue now seg faults:
moorepants@garuda:~$ ipython
Python 3.5.4 | packaged by conda-forge | (default, Aug 10 2017, 01:38:41)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %paste
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
from numpy import arange, pi, cos, sin
from traits.api import HasTraits, Range, Instance, \
on_trait_change
from traitsui.api import View, Item, Group
from mayavi.core.api import PipelineBase
from mayavi.core.ui.api import MayaviScene, SceneEditor, \
MlabSceneModel
dphi = pi/1000.
phi = arange(0.0, 2*pi + 0.5*dphi, dphi, 'd')
def curve(n_mer, n_long):
mu = phi*n_mer
x = cos(mu) * (1 + cos(n_long * mu/n_mer)*0.5)
y = sin(mu) * (1 + cos(n_long * mu/n_mer)*0.5)
z = 0.5 * sin(n_long*mu/n_mer)
t = sin(mu)
return x, y, z, t
class MyModel(HasTraits):
n_meridional = Range(0, 30, 6, )#mode='spinner')
n_longitudinal = Range(0, 30, 11, )#mode='spinner')
scene = Instance(MlabSceneModel, ())
plot = Instance(PipelineBase)
# When the scene is activated, or when the parameters are changed, we
# update the plot.
@on_trait_change('n_meridional,n_longitudinal,scene.activated')
def update_plot(self):
x, y, z, t = curve(self.n_meridional, self.n_longitudinal)
if self.plot is None:
self.plot = self.scene.mlab.plot3d(x, y, z, t,
tube_radius=0.025, colormap='Spectral')
else:
self.plot.mlab_source.set(x=x, y=y, z=z, scalars=t)
# The layout of the dialog created
view = View(Item('scene', editor=SceneEditor(scene_class=MayaviScene),
height=250, width=300, show_label=False),
Group(
'_', 'n_meridional', 'n_longitudinal',
),
resizable=True,
)
my_model = MyModel()
my_model.configure_traits()
## -- End pasted text --
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 628
vtkXOpenGLRenderWindow (0x492f260): GLEW could not be initialized.
Segmentation fault (core dumped)
FWIW The example script @moorepants returns...
NotImplementedError: the null tvtk.pyface.ui.null backend doesn't implement scene_editor:SceneEditor
On this particular build...
Platform: macOS-10.16-x86_64-i386-64bit Python: 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ] Executable: ../miniconda3/envs/sci/bin/python3.8 CPU: i386: 12 cores Memory: Unavailable (requires "psutil" package) mne: 0.22.dev0 numpy: 1.19.4 {blas=openblas, lapack=openblas} scipy: 1.5.4 matplotlib: 3.3.3 {backend=module://ipykernel.pylab.backend_inline}
sklearn: Not found numba: Not found nibabel: 3.2.0 cupy: Not found pandas: Not found dipy: Not found mayavi: 4.7.3.dev0 pyvista: Not found vtk: 9.0.1 PyQt5: Not found
conda version : 4.9.2 conda-build version : not installed python version : 3.7.9.final.0 virtual packages : osx=10.16=0 unix=0=0 __archspec=1=x86_64
Also, this build using ipy
backend in a Jupyter notebook kernel appears to work as expected with test call
from mayavi import mlab
mlab.init_notebook()
mlab.test_contour3d()
10.16 is an alias for Big Sur, right? It seems that PyQt5 / Qt5 is not yet Big Sur compatible:
https://github.com/matplotlib/matplotlib/issues/18954 https://bugreports.qt.io/browse/QTBUG-85546
At least I upgraded two days ago, and since then all Qt5 windows (PyQt5 and pyside2) don't show up, and the PyQt5 ones freeze my interpreter.
So maybe the null
backend stuff really has to do with upstream libraries / backends not working properly.
10.16 is an alias for Big Sur, right?
Yes. The rest of all the Qt5/traits/py -face/-side, vtk, etc. business after OS updates are way out of my wheelhouse - I usually just pray it doesn't affect other NIX platforms 😨
So maybe the null backend stuff really has to do with upstream libraries / backends not working properly.
My knee jerk is always blaming the 'backend'.
I tried this example from the mayavi docs:
http://docs.enthought.com/mayavi/mayavi/auto/example_mlab_interactive_dialog.html#example-mlab-interactive-dialog
I get this error:
Info: