cytoscape / ipycytoscape

A Cytoscape Jupyter widget
https://ipycytoscape.readthedocs.io/en/master/
BSD 3-Clause "New" or "Revised" License
264 stars 62 forks source link

Error displaying widget: model not found #253

Closed dbrnz closed 3 years ago

dbrnz commented 3 years ago

Bug report

Bug summary

Attempting to display a graph results in Error displaying widget: model not found.

Is this closed issue #22 reappearing??

Code for reproduction

import ipycytoscape
import ipywidgets as widgets
import networkx as nx

G = nx.complete_graph(5)
undirected = ipycytoscape.CytoscapeWidget()
undirected.graph.add_graph_from_networkx(G)
undirected

Actual outcome

Error displaying widget: model not found

Expected outcome

A visualisation of the graph.

Version Info

dbrnz commented 3 years ago

jupyter labextension list results in:

JupyterLab v3.0.12
/Users/dave/.local/share/virtualenvs/lab-uPHGVNse/share/jupyter/labextensions
        jupyter-cytoscape v1.2.0 enabled OK
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /Users/dave/.local/share/virtualenvs/lab-uPHGVNse/share/jupyter/lab
        jupyter-leaflet v0.13.2 enabled OK
ianhi commented 3 years ago

Hi @dbrnz how did you install ipycytoscape? Can you check that the following works in a new environment?

mamba create -n cyto-test jupyterlab
conda activate cyto-test
pip install ipycytoscape
jupyter lab
dbrnz commented 3 years ago

@ianhi, ipycytoscape was installed into an existing Jupyter Lab 2.0 environment that was then upgraded to 3.0, so maybe there is an issue around upgrading.

I have just tried a fresh installation in a new environment and things work as expected.

# In an empty directory
pipenv install jupyterlab ipycytoscape
pipenv run jupyter lab
ianhi commented 3 years ago

ipycytoscape was installed into an existing Jupyter Lab 2.0 environment that was then upgraded to 3.0, so maybe there is an issue around upgrading.

That's very plausible - unfortunately I think that if this is an issue it's really an upstream issue as ipycytoscape just followed the recommended changes. So let's close this as resolved with the solution of a new environment. (Feel free to re-open if you'd like)