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
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.