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_const.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gnuradio-core/src/utils/gr_plot_const.py') diff --git a/gnuradio-core/src/utils/gr_plot_const.py b/gnuradio-core/src/utils/gr_plot_const.py index 9ec75ddb9a..1503363bd5 100755 --- a/gnuradio-core/src/utils/gr_plot_const.py +++ b/gnuradio-core/src/utils/gr_plot_const.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,9 +20,19 @@ # Boston, MA 02110-1301, USA. # -import scipy -from pylab import * -from matplotlib.font_manager import fontManager, FontProperties +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + +try: + from pylab import * + from matplotlib.font_manager import fontManager, FontProperties +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