From 569e736107f54501f38cd1edf81a94e23785f732 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Wed, 18 Sep 2024 09:56:20 +0200 Subject: [PATCH] Raise an ImportError for the Python API in JupyterLite --- python/jupytergis_lab/jupytergis_lab/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/jupytergis_lab/jupytergis_lab/__init__.py b/python/jupytergis_lab/jupytergis_lab/__init__.py index 0e97f0eb..fde10955 100644 --- a/python/jupytergis_lab/jupytergis_lab/__init__.py +++ b/python/jupytergis_lab/jupytergis_lab/__init__.py @@ -7,8 +7,12 @@ import warnings __version__ = "dev" -from .notebook import GISDocument # noqa +import sys + +if sys.platform == "emscripten": + raise ImportError("Cannot use the JupyterGIS Python API in a JupyterLite kernel yet") +from .notebook import GISDocument # noqa def _jupyter_labextension_paths(): return [{"src": "labextension", "dest": "@jupytergis/jupytergis-lab"}]