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 (still)

See original GitHub issue

Description I have been struggling with the problem described in this issue and this one for a few days now. I’ve tried the instructions but they don’t seem to fix the problem. I can’t reopen the issue so I have created a new one here.

To Reproduce When I type:

from keplergl import KeplerGl
map_1 = KeplerGl()
map_1

I get:

User Guide: https://docs.kepler.gl/docs/keplergl-jupyter
Error displaying widget: model not found

Developer console error:

manager.js:319 Uncaught (in promise) Error: Module keplergl-jupyter, semver range ^0.2.0 is not registered as a widget module
    at WidgetManager.loadClass (manager.js:319)
    at WidgetManager.<anonymous> (manager-base.js:264)
    at step (manager-base.js:45)
    at Object.next (manager-base.js:26)
    at manager-base.js:20
    at new Promise (<anonymous>)
    at push.SEna.__awaiter (manager-base.js:16)
    at WidgetManager.push.SEna.ManagerBase._make_model (manager-base.js:258)
    at WidgetManager.<anonymous> (manager-base.js:247)
    at step (manager-base.js:45)

Expected behavior I expect to see a slippy map.

Environment (please complete the following information):

  • Python 3.6.8
  • Windows 10 jupyter --version
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : 4.7.5
ipython          : 7.15.0
ipykernel        : 5.3.0
jupyter client   : 6.1.3
jupyter lab      : 2.1.4
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.6
traitlets        : 4.3.3

jupyter labextension list

JupyterLab v2.1.4
Known labextensions:
   app dir: C:\Users\[USER]\.conda\envs\py36\share\jupyter\lab
        @jupyter-widgets/jupyterlab-manager v2.0.0 enabled  ok
        @jupyterlab/toc v3.0.0 enabled  ok
        js v0.1.0 enabled  ok
        jupyter-gmaps v0.9.0 enabled  ok
        jupyter-leaflet v0.13.0 enabled  ok
        jupyterlab-jupytext v1.2.1 enabled  ok
        jupyterlab-stata-highlight v0.1.1 enabled  ok
        keplergl-jupyter v0.2.0 enabled  ok

Additional context The problem seems to affect any extensions with a slippy map, including gmaps and ipyleaflet. I believe it arose when I downloaded and started to use kepler (probably from updating some packages in the process?) since gmaps used to work. To be clear, it’s fine in Jupyter notebook, just not in lab.

Any thoughts would be much appreciated!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

4reactions
ramayercommented, Mar 24, 2021

The best workaround I found so far is to wrap it in an iframe like this:

import keplergl
import base64

map1      = keplergl.KeplerGl()
orig_html = str(map1._repr_html_(),'utf-8')
b64d_html = base64.b64encode(orig_html.encode('utf-8')).decode('utf-8')
framed_html = f'<iframe src="data:text/html;base64,{b64d_html}" style="width:95%; height: 600px">'
import IPython
IPython.display.HTML(framed_html)
2reactions
imaginefishcommented, Aug 9, 2020

I also got the same bug report with jupyter lab, but jupyter notebook works.

  • python error

Error displaying widget: model not found

  • console error

renderer.js:45 Error: widget model not found at C.get_model (manager.js:375) at h.renderModel (renderer.js:38) renderModel @ renderer.js:45

  • macOS version: 10.15.6
  • node version: v12.18.3
  • keplergl vesion: 0.2.0

Here are my jupyter version:

jupyter core : 4.6.3 jupyter-notebook : 6.1.1 qtconsole : 4.7.5 ipython : 7.16.1 ipykernel : 5.3.4 jupyter client : 6.1.6 jupyter lab : 2.1.5 nbconvert : 5.6.1 ipywidgets : 7.5.1 nbformat : 5.0.7 traitlets : 4.3.3

All jupyter lab extensions are installed and enabled:

JupyterLab v2.1.5 Known labextensions: app dir: /opt/anaconda3/share/jupyter/lab @jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK keplergl-jupyter v0.2.0 enabled OK

I guess there are still some bugs when using jupyter lab in current version of keplergl(0.2.0), hope someone can fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

“Error displaying widget: model not found” with Jupyter lab #112
I thought I was going mad. What poor timing! Pip installing the master branch of ipympl didn't work for me. Still getting the...
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 -- 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 >
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 >
Issue with stackview inside JupyterLab - "Error displaying widget
... notebook but encountered a problem which I could solve so far. ... inside JupyterLab - "Error displaying widget: model not found".
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