File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11from enum import Enum
22from importlib import import_module
3+ from packaging import version
4+ import importlib_metadata
35import sys
46
57
@@ -28,7 +30,6 @@ def find_env():
2830 else :
2931 return Env .SAGEMAKER
3032 except :
31- import sys
3233 if sys .platform == 'emscripten' :
3334 return Env .JUPYTERLITE
3435 return Env .HYPHA
@@ -38,6 +39,15 @@ def find_env():
3839
3940if ENVIRONMENT is not Env .JUPYTERLITE and ENVIRONMENT is not Env .HYPHA :
4041 if ENVIRONMENT is not Env .COLAB :
42+ if ENVIRONMENT is Env .JUPYTER_NOTEBOOK :
43+ notebook_version = importlib_metadata .version ('notebook' )
44+ if version .parse (notebook_version ) < version .parse ('7' ):
45+ raise RuntimeError ('itkwidgets 1.0a51 and newer requires Jupyter notebook>=7.' )
46+ elif ENVIRONMENT is Env .JUPYTERLAB :
47+ lab_version = importlib_metadata .version ('jupyterlab' )
48+ if version .parse (lab_version ) < version .parse ('4' ):
49+ raise RuntimeError ('itkwidgets 1.0a51 and newer requires jupyterlab>=4.' )
50+
4151 try :
4252 import_module ("imjoy-jupyterlab-extension" )
4353 except ModuleNotFoundError :
You can’t perform that action at this time.
0 commit comments