Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load model class 'LeafletMapModel' from module 'jupyter-leaflet' #583

Closed
JosephKuchar opened this issue Oct 31, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@JosephKuchar
Copy link

Environment Information

leafmap v.0.27.1
ipyleaflet v.0.17.4
Python version: 3.12.0
Operating System: Ubuntu 20.04

Description

I've been trying to get a GPU-enabled docker container running with the segment anything geospatial package. I'm running a docker container of GPU Jupyter, which are GPU enabled jupyter environments. My main issue has been getting leafmap to work in this environment. After creating a fresh conda environment and installing ipyleaflet and leafmap, attempting to create a map results in a javascript error in the jupyter notebook.

m = leafmap.Map(center=[29.676840, -95.369222], zoom=19)
m.add_basemap("SATELLITE")
m

And the error:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'LeafletMapModel' from module 'jupyter-leaflet'
Error: No version of module jupyter-leaflet is registered
    at f.loadClass (http://localhost:8848/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:74856)
    at f.loadModelClass (http://localhost:8848/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:10729)
    at f._make_model (http://localhost:8848/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:7517)
    at f.new_model (http://localhost:8848/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:5137)
    at f.handle_comm_open (http://localhost:8848/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:3894)
    at _handleCommOpen (http://localhost:8848/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:73393)
    at b._handleCommOpen (http://localhost:8848/static/lab/jlab_core.d992fc793fb2c108d6cc.js?v=d992fc793fb2c108d6cc:2:1037310)
    at async b._handleMessage (http://localhost:8848/static/lab/jlab_core.d992fc793fb2c108d6cc.js?v=d992fc793fb2c108d6cc:2:1039300)

I've tried upgrading and downgrading notebook, ipyleaflet, and leafmap, because I've seen some discussion that similar errors might result from version mismatches, but so far I've had no luck in resolving this issue.

@JosephKuchar JosephKuchar added the bug Something isn't working label Oct 31, 2023
@giswqs
Copy link
Member

giswqs commented Oct 31, 2023

This is an ipyleaflet issue rather than a leafmap issue. If you can create a docker with just ipyleaflet that's working, then leafmap should work as well.

@JosephKuchar
Copy link
Author

Thanks, I've duplicated my issue in the ipyleaflet repository, this one can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants