I'm trying to run a jupyter notebook featuring interactive ipywidgets using a new laptop with a new installation of jupyter/ anaconda, but consistently get the error 'Javascript Error: IPython is not defined', e.g. when running the following:
%matplotlib nbagg
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
I've tried installing Anaconda navigator, and after the above was unsuccessful tried using conda to install ipython
and ipympl
, but still got the 'IPython is not defined' error.
Currently, starting with Miniconda3 py313_25.3.1.1, I've tried
pip install notebook
conda install matplotlib
conda install ipython
conda install ipympl
(all in the default base
environment) I then restarted my PC, and when I try ipython --version
in the terminal I get 8.30.3 but still get the `IPython is not defined' error in the jupyter notebook.
In the jupyter notebook, I'm using the Python 3 (ipykernel) Kernel.
Reactive base environment
conda activate base
Ensure extensions work
jupyter nbextension enable --py widgetsnbextension
jupyter nbextension enable --py ipympl
restart your PC.
re-run
jupyter notebook
In notebook, Kernel --> restart and clear ouput, Run all cells.