enthought / enthought/mayavi

ImportError: Could not import backend for traitsui.

Open
#1,297 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

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 "", line 1, in
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.