diff options
author | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-01-30 22:28:15 +0000 |
---|---|---|
committer | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-01-30 22:28:15 +0000 |
commit | c2c1ba21350d588adb4ec8f2f815f50df81927f8 (patch) | |
tree | df7b85f974521ef7df68f7d33e4c6eecd9835039 /gnuradio-core/src/utils/gr_plot_const.py | |
parent | f52a5932f178e474b625e86fb85c1c8954334398 (diff) |
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
Diffstat (limited to 'gnuradio-core/src/utils/gr_plot_const.py')
-rwxr-xr-x | gnuradio-core/src/utils/gr_plot_const.py | 18 |
1 files changed, 14 insertions, 4 deletions
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) |