diff --git a/aiidalab_widgets_base/databases.py b/aiidalab_widgets_base/databases.py index 9b7bd149a..4f34f0f06 100644 --- a/aiidalab_widgets_base/databases.py +++ b/aiidalab_widgets_base/databases.py @@ -156,7 +156,17 @@ def __init__( title: str = None, **kwargs, ) -> None: - from optimade_client import default_parameters, query_filter, query_provider + try: + from optimade_client import default_parameters, query_filter, query_provider + except ImportError: + super().__init__( + [ + ipw.HTML( + "This widget requires the `optimade-client` package to be installed." + ) + ] + ) + return providers_header = ipw.HTML("