From a293aaf062e92b1219e79392901cee7d8a482a06 Mon Sep 17 00:00:00 2001 From: Piotr Date: Thu, 6 Jul 2023 15:35:26 +0200 Subject: [PATCH] fix font loading (#637) --- supervised/base_automl.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/supervised/base_automl.py b/supervised/base_automl.py index 135911f0..8b138a17 100644 --- a/supervised/base_automl.py +++ b/supervised/base_automl.py @@ -52,14 +52,17 @@ check_integer, ) from supervised.utils.utils import dump_data, load_data -import matplotlib.font_manager as font_manager -# Get a list of all font families available on the system -font_families = font_manager.findSystemFonts() -# Load the font file for the first font family in the list and get the name of the first font family -REPORT_FONT = font_manager.FontProperties(fname=font_families[0]).get_name() +try: + import matplotlib.font_manager as font_manager + # Get a list of all font families available on the system + font_families = font_manager.findSystemFonts() + # Load the font file for the first font family in the list and get the name of the first font family + REPORT_FONT = font_manager.FontProperties(fname=font_families[0]).get_name() +except Exception: + REPORT_FONT = "Arial" logger = logging.getLogger(__name__) logger.setLevel(LOG_LEVEL)