yWorks / yfiles-jupyter-graphs

The home of the Jupyter notebook graph visualization widget powered by yFiles for HTML
https://www.yworks.com/products/yfiles-graphs-for-jupyter
Other
133 stars 14 forks source link

Exception with ipywidgets 8 - AttributeError: 'super' object has no attribute '_ipython_display_' #18

Closed fskpf closed 1 year ago

fskpf commented 1 year ago

Describe the bug Widget fails with AttributeError: 'super' object has no attribute '_ipython_display_'

To Reproduce For example, install the widget in a fresh environment:

$ conda create -n currentlab -c conda-forge python jupyterlab
$ conda activate currentlab
$ pip install yfiles-jupyter-graphs

Then inspect the ipywidgets version that has been installed implicitly by the yfiles-jupyter-graphswidget

$ pip list

It'll show ipywidgets 8.x.x.

Then try to run the widget in a jupyter lab notebook. Among other errors, it'll throw AttributeError: 'super' object has no attribute '_ipython_display_'

Expected behavior It should just work.

fskpf commented 1 year ago

ipywidgets 8 is incompatible with the current widget.

For now, we should at least limit the required version of ipywidgets to the compatible version range. Currently, it just states

    install_requires=[
        'ipywidgets>=7.6.0'
    ],

Which installs the current, incompatible version 8 of ipywidgets.

This should be changed to

    install_requires=[
        'ipywidgets>=7.6.0,<8'
    ],

Eventually, we should also make it compatible with ipywidgets 8, see #19.