diff --git a/itkwidgets/integrations/environment.py b/itkwidgets/integrations/environment.py index de9225e7..c09b13fd 100644 --- a/itkwidgets/integrations/environment.py +++ b/itkwidgets/integrations/environment.py @@ -46,11 +46,14 @@ def find_env(): else: try: import_module("imjoy-jupyterlab-extension") - except: - if ENVIRONMENT is Env.JUPYTERLITE: - raise RuntimeError('imjoy-jupyterlab-extension is required. Install the package and refresh page.') - elif sys.version_info.minor > 7: - raise RuntimeError('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.') + except ModuleNotFoundError: + try: + import_module("imjoy_jupyterlab_extension") + except ModuleNotFoundError: + if ENVIRONMENT is Env.JUPYTERLITE: + raise RuntimeError('imjoy-jupyterlab-extension is required. Install the package and refresh page.') + elif sys.version_info.minor > 7: + raise RuntimeError('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.') try: import imjoy_elfinder diff --git a/pyproject.toml b/pyproject.toml index 80e73abe..a2c370af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,9 +60,9 @@ Source = "https://github.com/InsightSoftwareConsortium/itkwidgets" [project.optional-dependencies] all = [ - "imjoy-jupyterlab-extension >=0.1.13", + "imjoy-jupyterlab-extension ==0.1.13", "imjoy-elfinder[jupyter]", - "imjoy-jupyter-extension >=0.3.0", + "imjoy-jupyter-extension ==0.3.0", "aiohttp <4.0" ] lab = [