From 87022f877b717d0cd3569f59561b02c4d6404f02 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Mon, 17 May 2021 15:03:38 -0700 Subject: [PATCH] FIX add more informative error in get_texture if inkscape is not installed --- cortex/svgoverlay.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cortex/svgoverlay.py b/cortex/svgoverlay.py index eb60c5054..5513d8068 100644 --- a/cortex/svgoverlay.py +++ b/cortex/svgoverlay.py @@ -223,6 +223,15 @@ def get_texture(self, layer_name, height, name=None, background=None, labels=Tru missing bits=32 keyword input argument, did not seeme necessary to specify png bits. """ + # Give a more informative error in case we don't have inkscape + # installed + if INKSCAPE_VERSION is None: + raise RuntimeError( + "Inkscape doesn't seem to be installed on this system." + "SVGOverlay.get_texture requires inkscape." + "Please make sure that inkscape is installed and that is " + "accessible from the terminal.") + import matplotlib.pyplot as plt # Set the size of the texture if background is not None: