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.
pip install ipythoninstead ofconda, or maybe in notebook run!pip install ipythonand it should install it in Python which you use.%pip install ipythondid enable graphs to be displayed for the first time with%matplotlib widget(but not the deprecatednbagg). Also, the original full error message was simply 'Javascript Error: IPython is not defined' in a pink box in jupyter notebook 7 so unfortunately it wasn't providing any further information.