Matplotlib animation not appearing in Jupyter Notebook

I am experiencing difficulties in displaying Matplotlib animation in Jupyter Notebook. Previously, I could easily display it by using the %matplotlib notebook magic command, but ever since I downloaded the new Anaconda version (Anaconda3-2024.02-1) on my new laptop, it is not working. Moreover, the Jupyter Notebook interface now looks similar to Jupyter Lab’s, unlike before.

Previously, it looked like this:

And the animation appeared as this

And now it looks like

And the animation is also not displaying

This is the Jupyter version that I am using now

Selected Jupyter core packages...
IPython          : 8.20.0
ipykernel        : 6.28.0
ipywidgets       : 7.6.5
jupyter_client   : 8.6.0
jupyter_core     : 5.5.0
jupyter_server   : 2.10.0
jupyterlab       : 4.0.11
nbclient         : 0.8.0
nbconvert        : 7.10.0
nbformat         : 5.9.2
notebook         : 7.0.8
qtconsole        : 5.4.2
traitlets        : 5.7.1

(can I, by any chance, get the previous notebook?)

Unfortunately the only way to get the notebook magic to work currently is to downgrade to an earlier notebook version (i.e. before version 7).

There is a comprehensive answer to this on the Jupyter discourse listing all the possibilities.

For clarification here, there is no need to advise users to downgrade notebook. All that is required is to replace use of %matplotlib notebook with %matplotlib widget or %matplotlib ipympl (they are equivalent), which works on JupyterLab and Jupyter Notebook 7+. Behind the scenes Notebook 7+ is built using the same framework as JupyterLab and so the same backend can be used for both.

Yeah, it works perfectly with %matplotlib ipympl as before. Thanks.