I have the following situation with regard to packages for use with my JupyterLab notebooks:
- packages required whoever my code is used (
always_ ...
), - packages that are only needed on Binder (
binderonly_ ...
) , and - packages that are only needed when using a Jupyter notebook elsewhere, e.g., locally on in a cloned repo (
jupyteronly_ ...
)
Binder has an elegant way of handling this automatically, in with a requirements.txt
containing all (and only) 1,
always_pkgA
always_pkgB
...
and a .binder/requriments.txt
containing all (and only, 2,
-r ../requriments.txt
binderonly_pkgX
binderonly_pkgY
...
It’s tempting to replace this approach for local or cloned repo uses of JupyterLab with something like a jupyter/requirements.txt
containing
-r ../requriments.txt
jupyteronly_pkgP
jupyteronly_pkgQ
...
and special instructions to
pip install -r jupyter/requirements.txt
rather than the usual
pip install -r requirements.txt
when using Jupyter locally.
But I wonder — is there a better approach, or an idiom that people use for this kind of scenario?