From af7fb17607e9d6ff07dd3f2d1efa8fc0ce099433 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 21 Feb 2020 16:10:18 +0100 Subject: [PATCH] plotedge script: warn for numpy, matplotlib --- fpga/tests/plot_edgedetect.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/fpga/tests/plot_edgedetect.py b/fpga/tests/plot_edgedetect.py index d5bb34991..63925bd99 100755 --- a/fpga/tests/plot_edgedetect.py +++ b/fpga/tests/plot_edgedetect.py @@ -6,9 +6,19 @@ # at your option, any later version. See the LICENSE.txt file for the text of # the license. #----------------------------------------------------------------------------- -import numpy -import matplotlib.pyplot as plt + import sys +try: + import numpy +except ModuleNotFoundError: + print("Please install numpy module first.") + sys.exit(1) + +try: + import matplotlib.pyplot as plt +except ModuleNotFoundError: + print("Please install matplotlib module first.") + sys.exit(1) if len(sys.argv) != 2: print("Usage: %s " % sys.argv[0])