Open PennyQ opened 7 years ago
To force a particular backend you can specify with with the ETS_TOOLKIT
environment variable. Eg. at the commandline on unix the command ETS_TOOLKIT=qt4 mayavi
will run Mayavi under qt4 with either the pyside or pyqt backend.
If that doesn't work, then you have some problem with your installation, and a clean install of mayavi and dependencies may be required. The Mayavi which comes with Enthought's free Canopy python environment is known to work.
@PennyQ Were you trying to plot in the Jupyter Notebook? I was running into this issue again and again as well. Turns out you have to run mlab.init_notebook()
in the notebook, or %gui qt
in the qtconsole.
@thomasaarholt But after adding mlab.init_notebook(), it shows "Notebook initialized with x3d backend.". Where can I look at the graph?
@zangcc0474 "The graph"? You need to be way more specific when asking questions :)
mlab.init_notebook()
is a setup command. It tells mlab that in order to plot anything, it needs to use the x3d software to plot. The message you get is confirmation that it has started correctly.
The following code should give you a inline, interactive plot when used in the notebook. It will likely be a bit slow. Please let me know if it works.
from mayavi import mlab
mlab.init_notebook()
mlab.test_contour3d()
The equivalent when run in the qtconsole, will be much faster:
from mayavi import mlab
%gui qt
mlab.test_contour3d()
So I tried many ways (pip, conda, easy_install, python setup develop source_code) to install mayavi, with pyqt4 and all other dependences (traits, traitsui, pyface, apptools, envisage) installed with conda, on mac os 10.10.5, but there is always an error that:
I tried to install
TraitsBackendQt
but there is no matching package on current osx-64 , any suggestions on making it work? Many thanks!