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.

K3D fails in JupyterLab with jupyterlab_widgets=3?

See original GitHub issue
  • K3D version: 3.14
  • Python version: 3.8
  • Operating System: Linux/MacOS (reproduced on both)

Description

There is an issue with K3D alongside the latest versions of jupyterlab. Running with jupyterlab_widgets=3.* (default, currently latest) causes JS crashes, whereas manually setting to 1.1 works. The crash manifests itself first in the console

jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2 Plugin 'jupyter.extensions.k3d' failed to activate.
(anonymous) @ jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2

and then in a JS error in the notebook image Clicking opens this: image

What I Did

To reproduce, I create an empty env with conda create -n k3d-test python=3.8 numpy, activate it and then

  1. For the failing version, execute pip install jupyterlab k3d
  2. For the working version, execute pip install jupyterlab k3d jupyterlab-widgets==1.1

Web console log / python logs

Text content of the error show in notebook:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'PlotModel' from module 'k3d'
loadClass@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.083e6b37f2f7b2f04b5e.js?v=083e6b37f2f7b2f04b5e:1:74855
loadModelClass@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:10721
_make_model@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:7517
new_model@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:5137
handle_comm_open@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:3894
134/v/this._handleCommOpen@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.083e6b37f2f7b2f04b5e.js?v=083e6b37f2f7b2f04b5e:1:73392
_handleCommOpen@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:994422
async*_handleMessage@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:996423
async*19883/b/this._onWSMessage/this._msgChain<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:984339
promise callback*19883/b/this._onWSMessage@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:984324
EventHandlerNonNull*19883/b/this._createSocket@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:983870
b@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:985694
connectTo@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1004939
57847/d/this._connectToKernel@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1029974
setupKernel@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1027416
a@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1025256
connectTo@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1030739
_initialize@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:105591
async*initialize@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:105251
17454/_populate/<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:478398
promise callback*_populate@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:478095
17454/_revert/<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:480420
promise callback*_revert@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:480000
initialize@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:474758
async*69993/_createOrOpenDocument/d<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:462540
promise callback*_createOrOpenDocument@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:462528
open@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:460596
openOrReveal@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:460749
87144/H/execute/<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:442835
promise callback*execute@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:442823
45159/e.prototype.execute@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1353918
51156/restore/l<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1152443
restore@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1152341
async*restore@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:84019
restore@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:21511
Q@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:781873
80885/e.prototype.activatePlugin/n.promise<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1347126
promise callback*80885/e.prototype.activatePlugin@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1347090
80885/e.prototype.resolveRequiredService@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1347519
80885/e.prototype.activatePlugin/r<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1346946
80885/e.prototype.activatePlugin@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1346920
80885/e.prototype.resolveRequiredService@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1347519
80885/e.prototype.activatePlugin/r<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1346946
80885/e.prototype.activatePlugin@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1346920
80885/e.prototype.start/o<@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1348112
80885/e.prototype.start@http://localhost:8888/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:1348086
G@http://localhost:8888/static/lab/7796.80e6d936dca84c219c9e.js?v=80e6d936dca84c219c9e:1:8377
async*e@http://localhost:8888/static/lab/main.357caa106b0f0fb27cf2.js?v=357caa106b0f0fb27cf2:1:1074
async*37559@http://localhost:8888/static/lab/main.357caa106b0f0fb27cf2.js?v=357caa106b0f0fb27cf2:1:1101
a@http://localhost:8888/static/lab/main.357caa106b0f0fb27cf2.js?v=357caa106b0f0fb27cf2:1:11188
@http://localhost:8888/static/lab/main.357caa106b0f0fb27cf2.js?v=357caa106b0f0fb27cf2:1:68844
@http://localhost:8888/static/lab/main.357caa106b0f0fb27cf2.js?v=357caa106b0f0fb27cf2:1:68853

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
artur-trzesiokcommented, Dec 16, 2022

Please try 2.15.0 (https://pypi.org/project/k3d/ for conda-forge we need to wait a little bit). @renefritze contribution should solve that

0reactions
RonaldEnsingcommented, Nov 1, 2022

I’ve got a similar problem:

[Open Browser Console for more detailed log - Double click to close this message] Model class ‘PlotModel’ from module ‘k3d’ is loaded but can not be instantiated

Pinning ipywidgets==7.7.1 and jupyterlab_widgets==1.1.0 did not work for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

“Error displaying widget: model not found” with Jupyter Lab #265
I followed the pip installation instructions but get “Error displaying widget: ... Installing k3d after jupyterlab with pip this time resulted in an...
Read more >
Can't add extensions in JupyterLab due to error in build
This is most likely due to another extension you have installed in jupyterlab (for me it was jupyterlab-latex ).
Read more >
Overview — K3D-jupyter documentation
K3D -jupyter is a Jupyter Notebook 3D visualization package. The primary aim of K3D-jupyter is to be an easy 3D visualization tool, designed...
Read more >
k3d - PyPI
Note: do not run this command inside K3D-jupyter directory. $ jupyter labextension install @jupyter-widgets/jupyterlab-manager $ jupyter labextension install ...
Read more >
Installation — JupyterLab 3.6.0b0 documentation
JupyterLab can be installed using conda , mamba , pip , pipenv or docker . ... In case you can communicate via HTTP,...
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