Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: Could not import backend for traitsui. #1297

Open
orlitzky opened this issue Apr 26, 2024 · 0 comments
Open

ImportError: Could not import backend for traitsui. #1297

orlitzky opened this issue Apr 26, 2024 · 0 comments

Comments

@orlitzky
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant