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

Jupyter: Conda and Mamba #345

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions services_and_applications/jupyter/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ the Launcher and type ``conda list``. The libraries in the base environment shou
cover most use cases. This base environment is provided to the default "Python 3" notebook, visible in the
JupyterLab "Launcher" page.

From the Terminal, you can install additional libraries with a simple ``conda install`` to
From the Jupyter Terminal, you can install additional libraries with a simple ``conda install`` to
use in your current session. But these installed libraries won't persist across sessions
if your server is restarted.
if your server is restarted.

Since conda's dependency concretizer has sometimes problems to extend existing environments with new
libraries, you can also use the `mamba <https://github.com/mamba-org/mamba>`_ package manager. Just
ax3l marked this conversation as resolved.
Show resolved Hide resolved
install it with ``conda install -c conda-forge mamba`` and replace ``conda`` with ``mamba`` calls.


Creating your own Conda environment and notebook entry
Expand Down Expand Up @@ -185,6 +188,23 @@ You may follow these general steps to create and install packages within an any
- *install packages with conda or pip in the activate environment*



ax3l marked this conversation as resolved.
Show resolved Hide resolved
Example: Creating a Conda environment for Matplotlib Widgets
============================================================

We currently install Jupyterlab version 2, which needs additional treatment to get interactive extensions
`such as matplotlib widgets installed <https://github.com/matplotlib/ipympl>`_.
ax3l marked this conversation as resolved.
Show resolved Hide resolved

Here is an example how to install matplotlib:

::
ax3l marked this conversation as resolved.
Show resolved Hide resolved
conda install -c conda-forge ipympl==0.5.8``
ax3l marked this conversation as resolved.
Show resolved Hide resolved
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected]

Once the installation fishes, restart the kernel of your current notebook and refresh the page.
You can now use the `%matplotlib ipympl` magic before importing matplotlib to render interactive plots.
ax3l marked this conversation as resolved.
Show resolved Hide resolved


Manually stopping your JupyterLab session
-----------------------------------------

Expand Down