Add additional warning instructing on how to install in case we failed detecting jupyter notebook with an import error

This commit is contained in:
allegroai 2024-04-19 22:23:45 +03:00
parent 2717c7ea76
commit 3d920a49a7

View File

@ -348,6 +348,12 @@ class _JupyterObserver(object):
except Exception as ex: except Exception as ex:
cls._get_logger().warning('Could not read Jupyter Notebook: {}'.format(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 _script_exporter = None
# load pigar # load pigar