ImportError: Could not import backend for traitsui.
orlitzky opened this issue · 0 comments
orlitzky commented
With a fresh install of mayavi (git HEAD) using pip:
$ python
Python 3.11.8 (main, Apr 8 2024, 11:45:04) [GCC 13.2.1 20240210] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mayavi import mlab
>>> mlab.figure(bgcolor=(0, 0, 0), size=(1, 1))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mjo/.local/lib/python3.11/site-packages/mayavi/tools/figure.py", line 64, in figure
engine = get_engine()
^^^^^^^^^^^^
File "/home/mjo/.local/lib/python3.11/site-packages/mayavi/tools/engine_manager.py", line 94, in get_engine
return self.new_engine()
^^^^^^^^^^^^^^^^^
File "/home/mjo/.local/lib/python3.11/site-packages/mayavi/tools/engine_manager.py", line 139, in new_engine
check_backend()
File "/home/mjo/.local/lib/python3.11/site-packages/mayavi/tools/engine_manager.py", line 42, in check_backend
raise ImportError(msg)
ImportError: Could not import backend for traitsui. Make sure you
have a suitable UI toolkit like PyQt/PySide or wxPython
installed.
I have PyQt5 installed:
>>> from PyQt5.QtWidgets import QWidget
>>> from PyQt5.QtWidgets import QSizePolicy
>>> from PyQt5.QtWidgets import QApplication
>>> from PyQt5.QtWidgets import QMainWindow
>>> from PyQt5.QtGui import QCursor
>>> from PyQt5.QtCore import Qt
>>> from PyQt5.QtCore import QTimer
>>> from PyQt5.QtCore import QObject
>>> from PyQt5.QtCore import QSize
>>> from PyQt5.QtCore import QEvent
>>>
I don't expect you to guess what's wrong, but if you can give me a hint as to where the "no PyQt5" decision is being made, it would help me debug.