Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error: No version of module jupyter-threejs is registered #396

Closed
ghost opened this issue Feb 16, 2023 · 4 comments
Closed

Getting Error: No version of module jupyter-threejs is registered #396

ghost opened this issue Feb 16, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 16, 2023

This is the code I am running

from pythreejs import *
import ipywidgets
from IPython.display import display

from pythreejs._example_helper import use_example_model_ids
use_example_model_ids()

view_width = 600
view_height = 400

sphere = Mesh(
    SphereBufferGeometry(1, 32, 16),
    MeshStandardMaterial(color='red')
)

cube = Mesh(
    BoxBufferGeometry(1, 1, 1),
    MeshPhysicalMaterial(color='green'),
    position=[2, 0, 4]
)

camera = PerspectiveCamera( position=[10, 6, 10], aspect=view_width/view_height)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

scene = Scene(children = [sphere, cube, ambient_light, key_light], background=None)

renderer = Renderer(camera=camera,
                    scene=scene,
                    alpha=True,
                    clearOpacity=0,
                    controls=[OrbitControls(controlling=camera)])

display(renderer)

When I try to run that last line I get the error:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'RendererModel' from module 'jupyter-threejs'
Error: No version of module jupyter-threejs is registered
    at f.loadClass (http://localhost:59444/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:74856)
    at f.loadModelClass (http://localhost:59444/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:10729)
    at f._make_model (http://localhost:59444/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:7517)
    at f.new_model (http://localhost:59444/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:5137)
    at f.handle_comm_open (http://localhost:59444/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:3894)
    at _handleCommOpen (http://localhost:59444/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:73393)
    at b._handleCommOpen (http://localhost:59444/static/lab/jlab_core.c0430ccb496db993caa7.js?v=c0430ccb496db993caa7:2:1001250)
    at async b._handleMessage (http://localhost:59444/static/lab/jlab_core.c0430ccb496db993caa7.js?v=c0430ccb496db993caa7:2:1003240)

My JupyterLab version is 3.5.0
pythreejs version is 2.4.1
jupyter-threejs version is 2.4.0

@vidartf
Copy link
Member

vidartf commented Feb 17, 2023

Which version of ipywidgets do you have installed?

@vidartf
Copy link
Member

vidartf commented Feb 17, 2023

And what is the output of jupyter labextension list ?

@merlinND
Copy link

This sounds like the same problem as #389.

@vidartf
Copy link
Member

vidartf commented Feb 20, 2023

Thanks. Closing as a duplicate of #389.

@vidartf vidartf closed this as completed Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants