Skip to content

Commit

Permalink
BUG: imjoy_jupyterlab_extension argument to import_module
Browse files Browse the repository at this point in the history
Also remove duplicate try: except.

Suggested-by: @KumoLiu
  • Loading branch information
thewtex committed May 17, 2024
1 parent 3b172a4 commit a352010
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions itkwidgets/integrations/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,12 @@ def find_env():
# jupyterlab may not be available
pass
try:
import_module("imjoy-jupyterlab-extension")
import_module("imjoy_jupyterlab_extension")
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.')
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
Expand Down

0 comments on commit a352010

Please sign in to comment.