cluster:usage_tips:jupyter

This is an old revision of the document!


Jupyter

Jupyter is a notebook-based development platform for Python projects, widely used in machine learning projects. JuypyterHub is a service that provides Jypyter notebooks for users on a given machine. Currently, one jupyterHub server is accessible for Sleep Revolution researchers on the computing hub Salamander.

In order to access the JupyterHub server, access the VPN, and navigate to salamander.sleep.ru.is (if that doesn't work you can also try 130.208.209.2. You will be greeted with a login screen where you should use your Sleep revolution credentials (without @sleep.ru.is).

The default JupyterHub interface has 3 python environments installed one python3 environment, one TensorFlow environment, and one PyTorch environment.

JupyterHub allows each user to use their own python environments if the default ones have missing packages.

To create a new python environment we use conda, open a new terminal in jupyterhub.

The command for creating a new conda environment named aardvark for example is

conda create -n aardvark

Note the location of the new environment.

To be able to use the environment in jupyterhub you need to install ipykernel to the environment:

conda activate aardvark
conda install ipykernel

Finally, to register the environment with jupyterhub, type the command, replacing aardvark with the name of your environment, and displayname with a nice name for your environment that you can select from a dropdown list in jupyter.

.conda/path/to/environment/bin/python -m ipykernel install --name 'aardvark' --display-name "displayname"

To remove the aardvark environment, the command is:

jupyter kernelspec uninstall aardvark

To install a package, superpackage for example, to the example environment aardvark that you created and added to the JupyterHub open a new python console on JupyterHub by selecting the aardvark environment and executing the

conda install superpackage

After the installation, you should be able to restart the kernel, and use your new superpackage

  • cluster/usage_tips/jupyter.1641575304.txt.gz
  • Last modified: 2022/01/07 17:08
  • by benedikt