File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11from enum import Enum
2+ from importlib import import_module
23
34
45class Env (Enum ):
@@ -34,3 +35,21 @@ def find_env():
3435
3536
3637ENVIRONMENT = find_env ()
38+ print (f'ENVIRONMENT: { ENVIRONMENT } ' )
39+
40+ if ENVIRONMENT is not Env .COLAB :
41+ if ENVIRONMENT is Env .JUPYTER_NOTEBOOK :
42+ try :
43+ import imjoy_jupyter_extension
44+ except :
45+ raise RuntimeError ('imjoy-jupyter-extension is required. `pip install itkwidgets[notebook]` and refresh page.' )
46+ else :
47+ try :
48+ import_module ("imjoy-jupyterlab-extension" )
49+ except :
50+ raise RuntimeError ('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.' )
51+
52+ try :
53+ import imjoy_elfinder
54+ except :
55+ raise RuntimeError ('imjoy-elfinder is required. `pip install imjoy-elfinder` and refresh page.' )
You can’t perform that action at this time.
0 commit comments