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.

[Bug][Jupyter Widget] Error displaying widget: model not found

See original GitHub issue

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:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
heshan0131commented, May 13, 2020

just published keplergl==0.2.0 with support for JupyterLab 2.0

5reactions
ramayercommented, Mar 24, 2021

If anyone’s stuck on an old version of the components, this workaround worked for me:

test_map = keplergl.KeplerGl(height=600)
orig_html = str(test_map._repr_html_(),'utf-8')

better_html = orig_html
import base64
b64 = base64.b64encode(better_html.encode('utf-8'))
src = f"data:text/html;base64,{b64.decode('utf-8')}"
base64d_html = f'<iframe src="{src}" style="width:95%; height: 600px">'
import IPython
IPython.display.HTML(base64d_html)
Read more comments on GitHub >

github_iconTop Results From Across the Web

“Error displaying widget: model not found” with Jupyter lab #112
I followed your installation instructions on a fresh python and jupyter setup with pip but end up with “Error displaying widget: model not...
Read more >
Error displaying widget; model not found: 5 Fixes
In this article, we're talking about the “Error displaying widget: model not found” problem when using Jupyter Labs in Python.
Read more >
Error displaying widget: model not found -- how to fix this?
So as to use Stacked, I installed version 8: > pip uninstall ipywidgets > pip install ipywidgets==8.0.0b But upon displaying a Stacked ...
Read more >
Jupyter-matplotlib: Error displaying widget: model not found
Solved! Turned out ipywidget 7.5 breaks jupyter lab and it isaffecting other libraries too. https://github.com/plotly/plotly.py/issues/1659.
Read more >
Error displaying widget: model not found Yesterday Sweetviz ...
Hi,. I'm facing that bug: Error displaying widget: model not found. Yesterday, happened with Sweetviz, then I copied others recent snippets to work....
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