jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.47k stars 359 forks source link

Geemap/ipyleaflet not displaying map in Jupyter Notebooks #1202

Closed qtyree closed 1 month ago

qtyree commented 1 month ago

I am trying to use geemap and visualize maps in Jupyter Notebooks, but I cannot get around this "Failed to load model class 'LeafletMapModel' from module 'jupyter-leaflet'" error message.

image

I have tried several different fixes from other forums, but none have worked. I uninstalled and reinstalled geemap, ipyleaflet, and jupyter-leaflet. And I have run these lines:

jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-leaflet

This is what my labextensions look like:

image

Let me know if there is a way to fix this without creating a new environment. Thank you

giswqs commented 1 month ago

Try creating a fresh conda env to install geemap and JupyterLab.

conda create -n gee python=3.11
conda activate gee
conda install geemap -c conda-forge
qtyree commented 1 month ago

Thank you Qiusheng. That works, but I was hoping to install it in an existing environment that already has other software installed. Any thoughts on how to debug this?

martinRenou commented 1 month ago

I see jupyterlab-plotly and @pyviz/jupyterlab_pyviz in the list of lab extensions, I can't remember which one (the first one?) but IIRC one of those is not updated to work with latest ipywidgets and breaks other widgets. I'd suggest uninstalling it.