matplotlib / ipympl

Matplotlib Jupyter Integration
https://matplotlib.org/ipympl/
BSD 3-Clause "New" or "Revised" License
1.57k stars 226 forks source link

Installing ipympl without matplotlib ? #560

Open mboisson opened 1 month ago

mboisson commented 1 month ago

Hi, Apparently, to use ipympl with Jupyter, one needs to install it in the kernel that runs the jupyterhub: https://github.com/matplotlib/ipympl/issues/547

but that also installs matplotlib, which is a no go.

Can we install ipympl without installing matplotlib, so that our users can install whatever matplotlib they want ?

Thanks

martinRenou commented 1 month ago

Hi,

Your users can always pip install the matplotlib version they want in the kernel from the notebook with the %pip magic. Though keep in mind ipympl does not work with all the matplotlib versions available.

You can also install ipympl with pip and the --no-deps option to not pull matplotlib, but you'd need to install other dependency manually.

Ideally we would split the front-end components from the Python library in ipympl, as we've done elsewhere for widgets. That way you could just install the front-end component and your users would be responsible for installing ipympl in the kernel if they want to use it