File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 65
65
except ImportError :
66
66
# Try using PySide
67
67
QT_API = QT_API_PYSIDE
68
+ cond = ("Could not import sip; falling back on PySide\n "
69
+ "in place of PyQt4 or PyQt5.\n " )
70
+ verbose .report (cond , 'helpful' )
68
71
69
72
if _sip_imported :
70
73
if QT_API == QT_API_PYQTv2 :
@@ -123,7 +126,13 @@ def _getSaveFileName(*args, **kwargs):
123
126
__version__ = QtCore .PYQT_VERSION_STR
124
127
125
128
else : # try importing pyside
126
- from PySide import QtCore , QtGui , __version__ , __version_info__
129
+ try :
130
+ from PySide import QtCore , QtGui , __version__ , __version_info__
131
+ except ImportError :
132
+ raise ImportError (
133
+ "Matplotlib qt-based backends require an external PyQt4, PyQt5,\n "
134
+ "or PySide package to be installed, but it was not found." )
135
+
127
136
if __version_info__ < (1 , 0 , 3 ):
128
137
raise ImportError (
129
138
"Matplotlib backend_qt4 and backend_qt4agg require PySide >=1.0.3" )
You can’t perform that action at this time.
0 commit comments