question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to display map object using ipyleaflet in jupyter notebook or jupyter Lab

See original GitHub issue

I am trying to run jupyter notebook and/or jupyter Lab on mac book Catalina.

Code

from ipyleaflet import Map, Marker

start_location = (53.551086, 9.993682)

m = Map(center=start_location, zoom=16, scroll_wheel_zoom=True)

display(m)

I get no error message pops up in notebook. The map object does not display but gets created. type(m) outputs ipyleaflet.leaflet.Map

In jupyter Lab I get this error message : Error displaying widget: model not found

I have followed these suggestions : ipyleaflet-map-object-doesnt-display-in-jupyter-notebook-but-it-gets-created and ipyleaflet/issues/504 but it did not solve my problem.
. I have run jupyter labextension install jupyter-leaflet in my environment, and now get Loading widget... as output in Jupyter Lab. They is still ne hint in Jupyter notebook

Any hints on what I should try next? Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
martinRenoucommented, Oct 22, 2020

restart my kernel

You’ll also need to refresh the page to reload the JS

0reactions
ae3ecommented, Feb 16, 2021

@Ninthpool It’s probably a version problem. You can try to install specific version of the ipyleaflet package (0.12.2). Version of @jupyter-widgets/jupyterlab-manager also needs to be specified.

So install ipyleaflet : conda install -c conda-forge ipyleaflet=0.12.2

then install jupyter-leaflet: jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1 jupyter-leaflet@0.12.2

note the @1.1 and @0.12.2 which specify specific versions

You can also check your @jupyter-widgets/jupyterlab-manager version with jupyter labextension list You’ll get something like :

JupyterLab v1.2.6
Known labextensions:
   app dir: /opt/conda/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v1.1.0  enabled  OK
        @jupyterlab/javascript-extension v1.2.8  enabled  OK
        @jupyterlab/plotly-extension v1.0.0  enabled  OK
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ipyleaflet map object doesn't display in Jupyter Notebook but it ...
I just tried to install ipyleaflet with Jupyter 5.2.3: conda install -c conda-forge ipyleaflet. and also didn't get a map.
Read more >
ipyleaflet: Interactive maps in the Jupyter notebook ...
ipyleaflet : Interactive maps in the Jupyter notebook#. Try it online#. You can try ipyleaflet directly in this documentation page thanks to JupyterLite!...
Read more >
FAQ - leafmap
If the interactive map does not show up on Jupyter Notebook and JupyterLab, it is probably because the ipyleaflet extension is not installed...
Read more >
Interactive Maps in Jupyter - Descartes Labs Platform
The fastest and easiset way to get started with interactive maps is to use the Descartes Labs Workbench. There is no installation required,...
Read more >
Displaying satellite imagery on a web map
Functionality it provides is exposed to Python users by ipyleaflet. This library enables interactive maps in the Jupyter notebook/JupyterLab environment.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found