You are not logged in.

#1 2023-07-21 16:18:55

cscphy
Member
Registered: 2017-05-06
Posts: 39

Jupyter notebook and matplotlib

I recently upgraded jupyter, and it seems that the matplotlib extension has stopped to work properly.

In a python notebook, using:

%matplotlib notebook

gives no error, but when I try to plot I get:

Javascript Error: IPython is not defined

This used to work until recent updates.

I have installed:

jupyter-console 6.6.3-2
jupyter-nbclassic 1.0.0-1
jupyter-nbclient 0.8.0-1
jupyter-nbconvert 7.7.2-1
jupyter-nbformat 5.9.1-1
jupyter-notebook 7.0.0-1
jupyter-notebook-shim 0.2.3-2
jupyter-server 2.7.0-1
jupyter-server-fileid 0.9.0-1
jupyter-server-ydoc 0.8.0-5
jupyter-widgetsnbextension 1:4.0.8-1
jupyterlab 4.0.3-1
jupyterlab-pygments 0.2.2-1
python-comm 0.1.3-2
python-ipykernel 6.24.0-1
python-ipympl 0.9.3-1
python-ipywidgets 8.0.7-2
python-jupyter-client 8.3.0-1
python-jupyter-core 5.3.1-1
python-jupyter-events 0.6.3-4
python-jupyter-packaging 0.12.3-4
python-jupyter-server-terminals 0.4.4-4
python-jupyter-ydoc 1.0.2-2
python-jupyterlab_server 2.23.0-1
python-matplotlib-inline 0.1.6-4
python-matplotlib 3.7.2-1

Edit:

Downgrading to:

jupyter-nbconvert 7.6.0-1
jupyter-nbformat 5.9.0-1
jupyter-notebook 6.5.4-3
jupyter-notebook-shim 0.2.3-2
jupyter-server 2.6.0-1
jupyter-server-fileid 0.9.0-1
jupyter-server-ydoc 0.8.0-5
python-jupyter-server-terminals 0.4.4-3
jupyter-widgetsnbextension 1:4.0.7-2
jupyterlab 4.0.2-1
jupyterlab-pygments 0.2.2-1
python-jupyterlab_server 2.23.0-1
python-ipykernel 6.23.2-1
python-ipympl 0.7.0-5
python-ipywidgets 8.0.6-4
python-jupyter-client 8.2.0-2
python-jupyter-server-terminals 0.4.4-3
python-matplotlib 3.7.1-4
python-matplotlib-inline 0.1.6-4

solves the problem, at least for the moment...

Last edited by cscphy (2023-07-21 19:23:53)

Offline

#2 2023-07-22 09:01:30

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,287

Re: Jupyter notebook and matplotlib

jupyter notebook 7 is basically just a skin for jupyterlab, which doesn't support matplotlib widgets via python-matplotlib-inline. You should use python-ipympl instead.

Last edited by arojas (2023-07-22 09:03:09)

Offline

#3 2023-07-23 08:48:55

cscphy
Member
Registered: 2017-05-06
Posts: 39

Re: Jupyter notebook and matplotlib

arojas wrote:

jupyter notebook 7 is basically just a skin for jupyterlab, which doesn't support matplotlib widgets via python-matplotlib-inline. You should use python-ipympl instead.

Actually, python-ipympl is installed, see the list of packages above.

Offline

#4 2023-07-23 13:09:11

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,287

Re: Jupyter notebook and matplotlib

The command to use python-ipympl is

%matplotlib widget

Offline

#5 2023-07-23 16:56:32

cscphy
Member
Registered: 2017-05-06
Posts: 39

Re: Jupyter notebook and matplotlib

arojas wrote:

The command to use python-ipympl is

%matplotlib widget

That was not working. I was getting the error:

Warning: Cannot change to a different GUI toolkit: widget. Using notebook instead.

Last edited by cscphy (2023-07-23 16:56:47)

Offline

Board footer

Powered by FluxBB