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

Failed to load model class 'GraphModel' in jupyter lite #55

Closed
DylanShang opened this issue Aug 20, 2024 · 3 comments
Closed

Failed to load model class 'GraphModel' in jupyter lite #55

DylanShang opened this issue Aug 20, 2024 · 3 comments

Comments

@DylanShang
Copy link

code in jupyter-lite

%pip install yfiles_jupyter_graphs==1.7.3
from yfiles_jupyter_graphs import GraphWidget
GraphWidget()

Error information

Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'GraphModel' from module 'yfiles-jupyter-graphs'
Error: No version of module yfiles-jupyter-graphs is registered
    at f.loadClass (https://jupyterlite.readthedocs.io/en/stable/_static/extensions/@jupyter-widgets/jupyterlab-manager/static/446.fdf8b1b233cb8c1783f6.js?v=fdf8b1b233cb8c1783f6:1:74920)
    at f.loadModelClass (https://jupyterlite.readthedocs.io/en/stable/_static/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:10729)
    at f._make_model (https://jupyterlite.readthedocs.io/en/stable/_static/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:7517)
    at f.new_model (https://jupyterlite.readthedocs.io/en/stable/_static/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:5137)
    at f.handle_comm_open (https://jupyterlite.readthedocs.io/en/stable/_static/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:3894)
    at _handleCommOpen (https://jupyterlite.readthedocs.io/en/stable/_static/extensions/@jupyter-widgets/jupyterlab-manager/static/446.fdf8b1b233cb8c1783f6.js?v=fdf8b1b233cb8c1783f6:1:73457)
    at f._handleCommOpen (https://jupyterlite.readthedocs.io/en/stable/_static/build/jlab_core.3e62503.js:1:5918649)
    at async f._handleMessage (https://jupyterlite.readthedocs.io/en/stable/_static/build/jlab_core.3e62503.js:1:5920543)

Related issue:
#50

@DylanShang
Copy link
Author

@fskpf
Copy link
Member

fskpf commented Aug 20, 2024

Glad that you got it working.

From my experience, installing it with %pip install in the cell should work, when the kernel is restarted afterward (the restart is mandatory).
Have you tried to restart the kernel afterward? Maybe you restarted it to add the dependency in requirements.txt although the restart is the actual "fix". Anyway, adding it as dependency is also a good solution.

@DylanShang
Copy link
Author

Hi @fskpf, thanks for your reply
Since JupyterLite is powered by WebAssembly-based Python, each session is stateless, meaning newly installed libraries cannot be persistently added to the kernel. Therefore, adding the libraries to requirements.txt might be the only viable solution.

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