Did you already have a version of ipywidgets/ipympl installed in your environment, if so it's possible that that led to installation issues which are an unfortunately common issue for ipympl.
For me the following steps led to a working installation for jupyterlab 4.0.3:
To troubleshoot the ipympl installation I would recommend first printing out the versions as done in the ipympl issue template:
python -c "import sys; print('\n',sys.version); import ipympl; print('ipympl version:', ipympl.__version__)" && jupyter --version && jupyter nbextension list && jupyter labextension list
which gave the following for my working installation
Installed versions
```
3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:17) [GCC 12.2.0]
ipympl version: 0.9.3
Selected Jupyter core packages...
IPython : 8.14.0
ipykernel : 6.24.0
ipywidgets : 8.0.7
jupyter_client : 8.3.0
jupyter_core : 5.3.1
jupyter_server : 2.7.0
jupyterlab : 4.0.3
nbclient : 0.8.0
nbconvert : 7.7.2
nbformat : 5.9.1
notebook : not installed
qtconsole : not installed
traitlets : 5.9.0
JupyterLab v4.0.3
/home/ian/mambaforge/envs/test-jlab4/share/jupyter/labextensions
jupyter-matplotlib v0.11.3 enabled OK
jupyterlab_pygments v0.2.2 enabled X (python, jupyterlab_pygments)
@jupyter-widgets/jupyterlab-manager v5.0.8 enabled OK (python, jupyterlab_widgets)
/home/ian/.local/share/jupyter/labextensions
nbdime-jupyterlab v2.1.1 enabled X
The following extensions are outdated:
jupyterlab_pygments
nbdime-jupyterlab
Consider checking if an update is available for these packages.
```
Using mpl-interactions outside the notebook
You can also use mpl-interactions directly from a python script. Taking that example and running it without the %matplotlib ipympl magic from a python file then one of the other interactive matplotlib backends (e.g. the qt backend) will be chosen by default by matplotlib and two windows should pop up, allowing use of the library without ipywidgets:
Hopefully this will allow testing of the library independent of installation issues with ipympl
from @flekschas in https://github.com/openjournals/joss-reviews/issues/5651#issuecomment-1641072224
Addressing the installation instructions
These seem like issues with your ipympl installation. The installation
[jupyter]
addition to the installation instructions just makes a best effort to install compatible versions of ipympl and ipywidgets: https://github.com/mpl-extensions/mpl-interactions/blob/10b1a278a0ba952a830ea9e629a06531c0dc47d3/setup.cfg#L42-L44Did you already have a version of ipywidgets/ipympl installed in your environment, if so it's possible that that led to installation issues which are an unfortunately common issue for ipympl.
For me the following steps led to a working installation for jupyterlab 4.0.3:
To troubleshoot the ipympl installation I would recommend first printing out the versions as done in the ipympl issue template:
python -c "import sys; print('\n',sys.version); import ipympl; print('ipympl version:', ipympl.__version__)" && jupyter --version && jupyter nbextension list && jupyter labextension list
which gave the following for my working installation
Installed versions
``` 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:17) [GCC 12.2.0] ipympl version: 0.9.3 Selected Jupyter core packages... IPython : 8.14.0 ipykernel : 6.24.0 ipywidgets : 8.0.7 jupyter_client : 8.3.0 jupyter_core : 5.3.1 jupyter_server : 2.7.0 jupyterlab : 4.0.3 nbclient : 0.8.0 nbconvert : 7.7.2 nbformat : 5.9.1 notebook : not installed qtconsole : not installed traitlets : 5.9.0 JupyterLab v4.0.3 /home/ian/mambaforge/envs/test-jlab4/share/jupyter/labextensions jupyter-matplotlib v0.11.3 enabled OK jupyterlab_pygments v0.2.2 enabled X (python, jupyterlab_pygments) @jupyter-widgets/jupyterlab-manager v5.0.8 enabled OK (python, jupyterlab_widgets) /home/ian/.local/share/jupyter/labextensions nbdime-jupyterlab v2.1.1 enabled X The following extensions are outdated: jupyterlab_pygments nbdime-jupyterlab Consider checking if an update is available for these packages. ```Using
mpl-interactions
outside the notebookYou can also use
mpl-interactions
directly from a python script. Taking that example and running it without the%matplotlib ipympl
magic from a python file then one of the other interactive matplotlib backends (e.g. the qt backend) will be chosen by default by matplotlib and two windows should pop up, allowing use of the library without ipywidgets:Hopefully this will allow testing of the library independent of installation issues with ipympl