From c2c1ba21350d588adb4ec8f2f815f50df81927f8 Mon Sep 17 00:00:00 2001
From: trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5>
Date: Wed, 30 Jan 2008 22:28:15 +0000
Subject: Catching ImportError exception and giving (hopefully) useful error
 message to install the necessary packages.

git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7529 221aa14e-8319-0410-a670-987f0aec2ac5
---
 gnuradio-core/src/utils/gr_plot_iq.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

(limited to 'gnuradio-core/src/utils/gr_plot_iq.py')

diff --git a/gnuradio-core/src/utils/gr_plot_iq.py b/gnuradio-core/src/utils/gr_plot_iq.py
index 1752615618..f1f1c10526 100755
--- a/gnuradio-core/src/utils/gr_plot_iq.py
+++ b/gnuradio-core/src/utils/gr_plot_iq.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2008 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -20,8 +20,18 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-import scipy
-from pylab import *
+try:
+    import scipy
+except ImportError:
+    print "Please install SciPy to run this script (http://www.scipy.org/)"
+    raise SystemExit, 1
+
+try:
+    from pylab import *
+except ImportError:
+    print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)"
+    raise SystemExit, 1
+
 from optparse import OptionParser
 
 matplotlib.interactive(True)
-- 
cgit v1.2.3