Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs request (feature request?): Using ipympl when Jupyter and kernel are in different environments #486

Open
gwerbin opened this issue Sep 1, 2022 · 3 comments

Comments

@gwerbin
Copy link

gwerbin commented Sep 1, 2022

Describe the issue

This issue is a continuation from #112.

A very common use case involves a centrally-installed Jupyter instance running Jupyter kernels in various task-specific environments.

Examples include a shared Jupyterlab instance installed by a server administrator, or a single user with a highly-customized personal Jupyter configuration.

In these situations, it's usually undesirable (and sometimes impossible) for users to install and run Jupyter within their task-specific environment in order to make use of ipympl as per the official recommendation to use pip install ipympl for both the server/kernel-side package and the client/frontend-side extension.

What are the correct instructions for installing the "frontend" and "backend" components of ipympl separately, so that they can be used in two different environments?

If this is not currently a supported use case, consider this issue a much-desired feature request!

@martinRenou
Copy link
Member

Thanks for opening an issue!

It's currently not really possible to split them properly as far as I know, you'd have to install somewhat matching ipympl versions in both environments.

Ideally we should have a separate package for the backend (ipympl) and for the frontend (jupyter-matplotlib).

@gwerbin
Copy link
Author

gwerbin commented Sep 3, 2022

It's currently not really possible to split them properly as far as I know, you'd have to install somewhat matching ipympl versions in both environments.

Given that the kernel-side environment is usually controlled fully by individual users, this doesn't seem like an unreasonable restriction and is certainly better than nothing in the short term. Is it good enough to check jupyter labextension list and try to install the same version that is shown there, or does the jupyter-matplotlib package use a different versioning numbering system?

It's definitely a bit annoying to have the entire Jupyter frontend pulled into your environment that is only meant to run a kernel server, but still that's better than not being able to do this at all.

@martinRenou
Copy link
Member

Is it good enough to check jupyter labextension list and try to install the same version that is shown there, or does the jupyter-matplotlib package use a different versioning numbering system?

ipympl is a bit loose on the jupyter-matplotlib version requirement: https://github.com/matplotlib/ipympl/blob/main/ipympl/_version.py#L3

It's definitely a bit annoying to have the entire Jupyter frontend pulled into your environment that is only meant to run a kernel server

I can understand that, though to be fair, ipympl only installs a bunch of JavaScript files under PREFIX/share/jupyter/labextensions/jupyter-matplotlib/ (totaling less than 2MB probably) that won't be used. And ipympl does not pull the entire jupyterlab.

But I agree we could make things better by splitting both properly. It's something that I'd like to do at some point if I find time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants