From 3d920a49a71d7a22c779c318337228c847220b15 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Fri, 19 Apr 2024 22:23:45 +0300 Subject: [PATCH] Add additional warning instructing on how to install in case we failed detecting jupyter notebook with an import error --- clearml/backend_interface/task/repo/scriptinfo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clearml/backend_interface/task/repo/scriptinfo.py b/clearml/backend_interface/task/repo/scriptinfo.py index 12fa8bfe..69bd3739 100644 --- a/clearml/backend_interface/task/repo/scriptinfo.py +++ b/clearml/backend_interface/task/repo/scriptinfo.py @@ -348,6 +348,12 @@ class _JupyterObserver(object): except Exception as ex: cls._get_logger().warning('Could not read Jupyter Notebook: {}'.format(ex)) + if isinstance(ex, ImportError): + module_name = getattr(ex, "name", None) + if module_name: + cls._get_logger().warning( + 'Please install {name} using "pip install {name}"'.format(name=module_name) + ) _script_exporter = None # load pigar