Skip to content

Commit 573910d

Browse files
timonmerklarsonerpre-commit-ci[bot]
authored
Improve error message if qt binding could not be found (#205)
Co-authored-by: Eric Larson <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent cd6a069 commit 573910d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mne_qt_browser/_pg_figure.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,20 @@
2121
from os.path import getsize
2222

2323
import numpy as np
24+
25+
try:
26+
from qtpy.QtCore import Qt
27+
except Exception as exc:
28+
if exc.__class__.__name__ == "QtBindingsNotFoundError":
29+
raise ImportError(
30+
"No Qt binding found, please install PyQt6, PyQt5, PySide6, or PySide2"
31+
) from None
32+
else:
33+
raise
34+
2435
from qtpy.QtCore import (
2536
QEvent,
2637
QThread,
27-
Qt,
2838
Signal,
2939
QRectF,
3040
QLineF,

0 commit comments

Comments
 (0)