matplotlib / ipympl

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

Installing ipympl without matplotlib ? #560

Open mboisson opened 4 months ago

mboisson commented 4 months 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 4 months 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