cytoscape / ipycytoscape

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

Graph is never rendered, shows CytoscapeWidget instead #213

Closed iAmNawa closed 3 years ago

iAmNawa commented 3 years ago

from ipycytoscape import CytoscapeWidget import networkx as nx G = nx.complete_graph(5) cyto = CytoscapeWidget() cyto.graph.add_graph_from_networkx(G) display(cyto)

When running examples like this, the last command prints out... CytoscapeWidget(cytoscape_layout=...) It shows the exact same thing if I put print(cyto). running just cyto also prints out the exact same thing. I have tried multiple examples and all of them just print this instead of displaying a graph. Am I missing something here?

MridulS commented 3 years ago

Is this code inside a Jupyter notebook?

iAmNawa commented 3 years ago

Yes

MridulS commented 3 years ago

That's interesting.

Can you check what's the output of jupyter labextension list from your terminal ?

SylvainCorlay commented 3 years ago

jupyter nbextension list

for the classic notebook.

iAmNawa commented 3 years ago

'Jupyter command {} not found.'.format(jupyter_subcommand) Exception: Jupyter command jupyter-labextension not found.

iAmNawa commented 3 years ago

This notebook is running on RHEL and I am accessing it by URL, there are many users with notebooks on this server. Not sure if that changes things or not. I'm not sure about the labextension but our server is closed off to external URLs and only accessible by VPN, so not sure if this might be part of the issue.

marimeireles commented 3 years ago

Hey @iAmNawa did you try the jupyter nbextension list command? I think you might have gotten that error because you used a command for jupyter lab on a jupyter notebook

iAmNawa commented 3 years ago

Yes, sorry. When I run jupyter nbextension list I get PermissionError: [Errno 13] Permission denied. then it shows a URL string with the final path /notebook.d/bqplot.json

iAmNawa commented 3 years ago

I wanted to give an update, so nbextension list provides a list on one server but on another I get permission denied, so this makes me think there might be a permissions issue or configuration issue on the server. I am going to look into this and I will give you an update when I figure things out.

joseberlines commented 3 years ago

Hi Can that be related to rendering in a notebook or a Jupyter lab? I have the same issue. Same exactly notebook rendering the graph when I open anaconda notebook but if I open it in anaconda jupyter lab:

Screenshot 2020-12-21 at 17 32 07

the same happens when using display(G)

and when opening the notebook as such (not jup lap):

Screenshot 2020-12-21 at 17 34 53
marimeireles commented 3 years ago

I can't reproduce this with version 1.1.0 of ipycytoscape nor with master. I'd recommend creating a new environment from scratch and see if this is still happening.

joseberlines commented 3 years ago

I will have a new look to it in new environment

iAmNawa commented 3 years ago

In jupyter nbextension list there is jupyter-cytoscape/extension and it says enabled Validating: OK. I am still getting this issue, any next steps on how to resolve?

marimeireles commented 3 years ago

Hey @iAmNawa did you start from scratch from a new environment and you can still reproduce this?

marimeireles commented 3 years ago

Anyone can still reproduce smth like this?

lteu commented 3 years ago

Hi all, I encountered the same issue. My OS system is MacOS. Finally, I solved it after I had correctly installed the anaconda environment https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html and the library via command line with conda install.

I used to launch my notebook with python3 -m notebook and it did not work, I guess the environment was not configured correctly.

Now I launch with command line Jupyter notebook, and magically everything works well.

marimeireles commented 3 years ago

Yeah, the only way I could reproduce this kind of behavior was having a faulty environment. I'm going to close this one then. Thanks for the feedback @Iteu! :cherry_blossom: