From 71c743558e01e8a5afd120507eb871e2cfcd4e8f Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Fri, 22 Apr 2016 15:46:36 +0200 Subject: [PATCH] more robust import failure catching on importing plotting packages --- qcodes/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qcodes/__init__.py b/qcodes/__init__.py index 32ca3c455e3b..cc13fcf5f152 100644 --- a/qcodes/__init__.py +++ b/qcodes/__init__.py @@ -15,13 +15,17 @@ if in_notebook(): # pragma: no cover try: from qcodes.plots.matplotlib import MatPlot - except ImportError: - print('matplotlib plotting not supported') + except Exception: + print('matplotlib plotting not supported, ' + 'try "from qcodes.plots.matplotlib import MatPlot" ' + 'to see the full error') try: from qcodes.plots.pyqtgraph import QtPlot - except ImportError: - print('pyqtgraph plotting not supported') + except Exception: + print('pyqtgraph plotting not supported, ' + 'try "from qcodes.plots.pyqtgraph import QtPlot" ' + 'to see the full error') from qcodes.widgets.widgets import show_subprocess_widget