Skip to content

Commit 7a33ae5

Browse files
committed
BUG: Only emit package dependency errors for Python > 3.7
1 parent a5125ca commit 7a33ae5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

itkwidgets/integrations/environment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from enum import Enum
22
from importlib import import_module
3+
import sys
34

45

56
class Env(Enum):
@@ -37,7 +38,7 @@ def find_env():
3738
ENVIRONMENT = find_env()
3839

3940
if ENVIRONMENT is not Env.COLAB:
40-
if ENVIRONMENT is Env.JUPYTER_NOTEBOOK:
41+
if ENVIRONMENT is Env.JUPYTER_NOTEBOOK and sys.version_info.minor > 7:
4142
try:
4243
import imjoy_jupyter_extension
4344
except:
@@ -47,15 +48,14 @@ def find_env():
4748
import_module("imjoy-jupyterlab-extension")
4849
except:
4950
if ENVIRONMENT is Env.JUPYTERLITE:
50-
print('imjoy-jupyterlab-extension is required')
5151
raise RuntimeError('imjoy-jupyterlab-extension is required. Install the package and refresh page.')
52-
else:
52+
elif sys.version_info.minor > 7:
5353
raise RuntimeError('imjoy-jupyterlab-extension is required. `pip install itkwidgets[lab]` and refresh page.')
5454

5555
try:
5656
import imjoy_elfinder
5757
except:
5858
if ENVIRONMENT is Env.JUPYTERLITE:
5959
raise RuntimeError('imjoy-elfinder is required. Install the package and refresh page.')
60-
else:
60+
elif sys.version_info.minor > 7:
6161
raise RuntimeError('imjoy-elfinder is required. `pip install imjoy-elfinder` and refresh page.')

0 commit comments

Comments
 (0)