mayavi icon indicating copy to clipboard operation
mayavi copied to clipboard

mayavi run error

Open oldtime-tai opened this issue 5 years ago • 6 comments

hello, i find a main error when running based on mayavi:

ImportError: Could not import backend for traitsui.  Make sure you
        have a suitable UI toolkit like PyQt/PySide or wxPython

I find this error many times. it is so crazy!!!

my installization process is

conda create -n vis python=3.7
pip install vtk==8.1.2
pip install PyQt5
pip install mayavi

i find import mayavi # it is ok from mayavi import mlab # it is ok

mlab.figure() # it is not ok -----ImportError: Could not import backend for traitsui. Make sure you have a suitable UI toolkit like PyQt/PySide or wxPython

I try the PySide or wxPython, it's not ok also.

Can you help me find the solution?

Thanks~

oldtime-tai avatar Jul 29 '20 09:07 oldtime-tai

Can you tell us what the ETS_TOOLKIT environment variable is on your machine? If the environment variable isn't set, you should set it according to the toolkit backend you installed e.g. ETS_TOOLKIT="qt" or ETS_TOOLKIT="wx" depending on whether your are using PySide or wxPython.

rahulporuri avatar Jul 29 '20 09:07 rahulporuri

thank you for your reply.

i add export ETS_TOOLKIT="qt"

however, it's not ok , and error is RuntimeError: No pyface.toolkits plugin could be loaded for qt

I try Pyside and PyQt5, they are not ok.

oldtime-tai avatar Jul 29 '20 09:07 oldtime-tai

I apologize. ETS_TOOLKIT="qt4", not "qt"

rahulporuri avatar Jul 29 '20 09:07 rahulporuri

For reference, here are the acceptable values for ETS_TOOLKIT https://github.com/enthought/traitsui/blob/67ba31cdfd24a45d8f7047b093b8ec87c1db5f69/setup.py#L190-L196 https://github.com/enthought/pyface/blob/a55dfed5dc23a9363875310e6e3833c7d5294c38/setup.py#L205-L209 https://github.com/enthought/mayavi/blob/e2deb1218bfdf82bfcc939857495e27f73dd3442/setup.py#L460-L465

rahulporuri avatar Jul 29 '20 09:07 rahulporuri

ImportError: Could not import backend for traitsui. Make sure you have a suitable UI toolkit like PyQt/PySide or wxPython installed.

KangChou avatar Jun 26 '21 09:06 KangChou

For reference, here are the acceptable values for ETS_TOOLKIT https://github.com/enthought/traitsui/blob/67ba31cdfd24a45d8f7047b093b8ec87c1db5f69/setup.py#L190-L196 https://github.com/enthought/pyface/blob/a55dfed5dc23a9363875310e6e3833c7d5294c38/setup.py#L205-L209

https://github.com/enthought/mayavi/blob/e2deb1218bfdf82bfcc939857495e27f73dd3442/setup.py#L460-L465

Hello! My environment is ubuntu18.04, python 3.7.When I use mayavi to visualize the point cloud, the following error appears: ImportError: Could not import backend for trainsui Make sure you have a suitable UI toolkit like PyQt/PySide or wxPython installed. screenshot_69

But I have installed the required dependencies.

scre
screenshot_65
enshot_68 screenshot_67

I also defined the path of environment variables according to your suggestions to others:

screenshot_70

But this problem still exists. It's been bothering me for a long time. It's crazy. Could you help me?Thank you very much,sorry for your inconvenience.

Yuepengxin avatar Dec 02 '22 12:12 Yuepengxin