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.

Python Warning if ipycytoscape extension is not found?

See original GitHub issue

Hi all,

I would like to suggest the addition of a warning when ipycytoscape fails to find its jupyter notebook extension.

I was unable to run the Cola notebook example (or any other one) as ipycytoscape widget failed to be displayed. There was no Python traceback (nor error, nor warning) when the cell supposed to display the widget was executed (cell 4 with cytoscapeobj in Cola notebook example): no output, like a regular cell. On Binder or any working environment, this cell would return the interactive network widget.

I noticed a bunch of errors in the Javascript console when I ran the notebook. It seemed that the widget failed to instantiate: Could not instantiate widget (anonymous) @ manager-base.js:273. In the Jupyter console too, there was a 404 GET /nbextensions/jupyter-cytoscape/extension.js.

The problem was that I use jupyter_conda extension to manage project-specific kernels within a globally-installed Jupyter notebook: it automatically registers conda environments as suitable kernels to be used by a global jupyter notebook installation. Importantly, Jupyter notebook is not installed within the environment that owns the kernel. This means that ipycytoscape notebook extension was not installed at the right place when I followed the installation steps… which explains why it was not found (no widget displayed).

The obvious solution is to start jupyter notebook from within the conda environment in which ipycytoscape and its extension were installed, or to install ipycytoscape directly the base environment that owns jupyter notebook (which fails the purpose of jupyter_conda).

I believe this kind of problem would be easier to diagnostic if ipycytoscape would display a warning when it cannot find its extension (or a message like bokeh does when output_notebook() is called).

HTH

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ianhicommented, Sep 5, 2020

This looks like it will become part of ipywidgets core: https://github.com/jupyter-widgets/ipywidgets/pull/2960

1reaction
marimeirelescommented, Aug 17, 2020

In the meantime, maybe we could mention something in ipycytoscape install instructions to make sure users are aware that a jupyter notebook extension will be installed along the ipycytoscape package?

That’s a great idea @bdelepine, are you interested in making this contribution yourself? Since you had the problem maybe you can explain it better?

It’d be much appreciated. Thanks for the bug report 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Warning if ipycytoscape extension is not found? #135
Hi all, I would like to suggest the addition of a warning when ipycytoscape fails to find its jupyter notebook extension.
Read more >
ipycytoscape - PyPI
A Cytoscape widget for Jupyter.
Read more >
Ipycytoscape: A Cytoscape Jupyter Widget - Python - Morioh
Ipycytoscape : A widget enabling interactive graph visualization with cytoscape.js in JupyterLab and the Jupyter notebook.
Read more >
Installation — ipycytoscape 1.0.3 documentation
JupyterLab¶. In order to install the JupyterLab extension jupyter-cytoscape, you will first need to install nodejs, you can install it with conda by...
Read more >
Python warnings are not shown in VSCode notebooks
This is working as intended based on how Python's default warnings filter operates. You can override the default filter in a couple of...
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