Code Monkey home page Code Monkey logo

Comments (9)

Sinooshka avatar Sinooshka commented on August 15, 2024

I have the same issue on my VM on vertex AI workbench. On my conda environment "geemap" and other related modules/packages are installed. Nevertheless I can not visualize the map.
I appreciate any relevant comment on this topic.

from ipyleaflet.

carlosloslas avatar carlosloslas commented on August 15, 2024

I have also faced the same issue in a fresh Anaconda3 installation and following the ipyleaflet installation documentation

When I run the first example from the documentation

from ipyleaflet import Map, Marker

center = (52.204793, 360.121558)

m = Map(center=center, zoom=15)

marker = Marker(location=center, draggable=True)
m.add(marker);

display(m)

# Now that the marker is on the Map, you can drag it with your mouse,
# it will automatically update the `marker.location` attribute in Python

# You can also update the marker location from Python, that will update the
# marker location on the Map:
marker.location = (50, 356)

I run into the following error

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'LeafletMapModel' from module 'jupyter-leaflet'
@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js:1:74865
loadClass@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js:1:75222
@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js:1:10738
loadModelClass@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js:1:10890
@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js:1:7531
_make_model@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js:1:8204
@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js:1:5148
new_model@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js:1:5194
handle_comm_open@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js:1:3903
@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js:1:73409
@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js:1:73415
@http://localhost:8888/static/lab/jlab_core.0ce4be9dd0d52754fd8a.js:2:1039655

from ipyleaflet.

DonteRW avatar DonteRW commented on August 15, 2024

Any solutions?

I getting a similar or related 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:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.fe2572ece3b7955c89bb.js?v=fe2572ece3b7955c89bb:1:74933)
at f.loadModelClass (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:10728)
at f._make_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:7516)
at f.new_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:5136)
at f.handle_comm_open (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:3893)
at _handleCommOpen (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.fe2572ece3b7955c89bb.js?v=fe2572ece3b7955c89bb:1:73470)
at v._handleCommOpen (http://localhost:8888/static/notebook/3676.bundle.js:1:30808)
at async v._handleMessage (http://localhost:8888/static/notebook/3676.bundle.js:1:32702)

The Chrome Browser console is giving me:

Error: No version of module 336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1
....

Python 3.12.2
ipyleaflet 0.18.2
geemap 0.32.0

from ipyleaflet.

giswqs avatar giswqs commented on August 15, 2024

Did you try creating a new conda env to install the packages?

from ipyleaflet.

DonteRW avatar DonteRW commented on August 15, 2024

@giswqs Thanks for the response

It's a new env and a new conda python installation

from ipyleaflet.

giswqs avatar giswqs commented on August 15, 2024

How did you create the conda env and install the packages?

from ipyleaflet.

DonteRW avatar DonteRW commented on August 15, 2024

@giswqs

This is basically what I have done

conda create -n pyGIS
conda activate pyGIS

started installations

conda install conda-forge::geopandas
conda install conda-forge::xarray
conda install conda-forge::conda-libmamba-solver
conda install conda-forge::cartopy
....

in order to add the env to jupyter

conda install conda-forge::ipykernel

add environ

python -m ipykernel install --user --name=pyGIS

then

conda install conda-forge::geemap

conda install conda-forge::geehydro

#=======================================================
#=======================================================

then opened a notebook & switched to the env

import geemap
import ee
import folium
import geehydro
import numpy as np
import ipyleaflet
import os

ee auth

ee.Authenticate()

init

ee.Initialize()

...

aw_dem = ee.ImageCollection("JAXA/ALOS/AW3D30/V3_2")

test plot

Map = geemap.Map()
Map.setCenter(25, -10.0, 3.0);
Map.addLayer( aw_dem, {}, 'dem')
Map

and the error shows up

from ipyleaflet.

giswqs avatar giswqs commented on August 15, 2024

Try the following. Make sure ipyleaflet works properly before installing other packages.

conda create -n gee python=3.11
conda activate gee
conda install -n base mamba -c conda-forge
mamba install geemap -c conda-forge

from ipyleaflet.

DonteRW avatar DonteRW commented on August 15, 2024

@giswqs

I have installed but I am still getting the same error

But I saw a number of warnings pertaining to libmamba ( warning libmamba) during the installations, I do not know if they have any effect

e.g.
warning libmamba Could not parse mod/etag header

warning libmamba Extracted package cache 'C:\Users\yyy\anaconda3\pkgs\msys2-conda-epoch-20160418-1' has invalid size
warning libmamba Extracted package cache 'C:\Users\yyy\anaconda3\pkgs\m2w64-gcc-libs-core-5.3.0-7' has invalid size
... ...

After installaton, I have also run :

C:\Users\yyy>jupyter labextension list

And I am getting:

    bqplot v0.5.44 enabled  X (python, bqplot)
    ipyevents v2.0.1 enabled ok
    ipytree v0.2.2 enabled ok
    jupyter-leaflet v0.18.2 enabled ok
    jupyterlab-plotly v5.19.0 enabled  X
    jupyterlab_pygments v0.3.0 enabled ok (python, jupyterlab_pygments)
    @jupyter-widgets/jupyterlab-manager v5.0.10 enabled ok (python, jupyterlab_widgets)

The following extensions are outdated:
bqplot
jupyterlab-plotly

Consider checking if an update is available for these packages.

I do not know if the "outdated" packages have an effect

from ipyleaflet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.