kepler.gl: [Bug][Jupyter Widget] Error displaying widget: model not found
Describe the bug Attempting to display a map in JupyterLab 2.1.0 prints an error within Jupyter Lab: “Error displaying widget: model not found”
My guess (but I really am guessing!) is that the keplergl widget needs to be updated to play nicely with JupyterLab 2.1.0. (Or maybe I’m doing something stupid! This is the first time I’ve tried installing the keplergl widget!)
To Reproduce
Installation:
conda config --add channels conda-forge
conda create --name test_kepler python=3.8 jupyterlab ipywidgets nodejs
conda activate test_kepler
pip install keplergl
jupyter labextension install @jupyter-widgets/jupyterlab-manager keplergl-jupyter
jupyter lab
Create a new notebook and run:
from keplergl import KeplerGl
map_1 = KeplerGl()
map_1
Output:
User Guide: https://github.com/keplergl/kepler.gl/blob/master/docs/keplergl-jupyter/user-guide.md
Error displaying widget: model not found
Expected behavior A map should be displayed 😃
Environment:
- conda virtual environment
- Python version: 3.8.2
- keplergl Widget version 0.1.2
- jupyterlab 2.1.0
- ipywidgets 7.5.1
jupyter labextension list
JupyterLab v2.1.0
Known labextensions:
app dir: /home/jack/miniconda3/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
jupyterlab-plotly v4.6.0 enabled OK
keplergl-jupyter v0.1.2 enabled OK
Bug reports in other projects Here are issues in other projects where users report seeing the “Error displaying widget: model not found” issue:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (2 by maintainers)
If anyone’s stuck on an old version of the components, this workaround worked for me:
just published
keplergl==0.2.0
with support for JupyterLab 2.0A work-around in kepler’s Jupyter widget:
And then open
keplergl_map.html
in a browser. (And it looks gorgeous!)BTW,
pydeck
also suffers from the same problem: Runningdeck.show()
in a Jupyter Lab cell returnsError displaying widget: model not found
. A work-around inpydeck
is to rundeck.to_html()
and load the html in a browser.Ah, it seems your keplergl widget version is old. You’ll need the latest one that was released yesterday:
pip install keplergl —upgrade
Thanks @firasm, I thought I had upgraded to the latest one relased yesterday, but probably I did it in a wrong way… because well, after a
pip install keplergl --upgrade
, now it is working, the keplergl map is shown into JupyterLab.Though, in Chrome developer console, I still get that error:
I’m curious if I’m the only one now with a working keplergl widget in JupyterLab 2, who gets that error in console, or it’s a normal thing.
Regardless of that, anyway, big thanks to @heshan0131 and whoever else contributed to making this work in JupyterLab 2, and thank you @firasm for your guide towards making it work for me.
Thank you for your kind help @firasm Though, I haven’t solved the problem. I’ve done the following:
So now I have:
jupyter --version
Oh, maybe this is useful to highlight: I see from Chrome developer console this problem when I open a .ipynb file that uses Kepler.gl:
You can try my instructions here: https://github.com/firasm/keplergl_tutorial/blob/master/1 - Install/Installation instructions.ipynb.
You may need to also run
jupyter labextension install keplergl-jupyter
andjupyter labextension enable keplergl-jupyter
P.S. I’d also encourage you to update jupyter to 2.1.2 (
pip install jupyter --upgrade
) just in case something changed on their sideUpgrade widget to kepler.gl@^2 and supporting JupyterLab 2 https://github.com/keplergl/kepler.gl/pull/1110