Slider does not show after upgrade Jupyter

I’ve been using Julia in Jupyter Notebook (NB) to make interactive plots with Interact.jl. It worked well until I upgraded Jupyter, and then the slider disappeared without any error messages.

Before the upgrade:

  • NB version 6 (6.4.12) worked fine.
  • Lab version 3 (3.4.4) had issues with the slider not updating graphs, but I didn’t mind since NB was okay.

After the upgrade:

  • NB version 7 (7.1.2) and Lab version 4 (4.1.5) both failed to show the slider, with no errors.
  • Downgrading to NB 6.4.12 fixed the issue for NB.

Downgrading isn’t a long-term fix, however, and I’m looking for solutions for both NB (preferably) or Lab.

The issue seems to be with the frontend JavaScript. According to my understanding, Lab and NB used different frontend codes, with the old NB version somehow being “correct”. With NB 7.0 built on Lab 4.0, neither works now.

The problem’s MWE:

using Interact, Plots

@manipulate for n in 1:5:100
  plot(rand(n))
end

I’m on Windows 10 and 11, using ipywidgets 8.1.2 and Julia 1.10.2. I installed the widgets with:

  • conda install -n base -c conda-forge widgetsnbextension
  • conda install -n base -c conda-forge ipywidgets
  • jupyter nbextension install --py widgetsnbextension
  • jupyter nbextension enable --py widgetsnbextension

I’d appreciate any alternative solutions or fixes.

There’s also NbClassic that runs the older Jupyter Notebook interface on top of the Jupyter Server backend.

There is an issue already filed here with the title ’ Sliders not appearing with Interact’, and so I think that covers what you are finding, too.
That links over to webio-jupyterlab-provider broken with JupyterLab v4 that was filed in January and is still open.
I do see that someone states that NbClassic indeed is a work around at this time, see [here](webio-jupyterlab-provider broken with JupyterLab v4 · Issue #514 · JuliaGizmos/WebIO.jl · GitHub.

Thank you! I could confirm that NbClassic indeed works. Since NbClassic serves as a transitional product, I hope that future versions of JupyterLab and Jupyter Notebook will address and resolve the current issues.

I think at this point it is up to Interact.jl to fix in their package; however, I’m not 100% up on the inner workings.
I will say that ipywidgets already works well in JupyterLab and Jupyter Notebook 7 when using ipykernel. There are differences these days in how the output from the widgets has to get handled and things are more strict. In particular, code used without interact() has to be explicit in calling the widgets and address directly managing the output from the widgets.
I suspect these differences may be what will need to be handled by Interact.jl better. This is just conjecture based though on experience with use of ipywidgets with JupyterLab and ipykernel.

Thanks again for the info. I’ll take this question to the Julia forum and see if there’s a solution or workaround available.

1 Like