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 myenv for example is

conda create -n myenv

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 myenv
conda install ipykernel

Finally, to register the environment with jupyterhub, type the command, replacing myenv 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.

You also need to replace the path to your environment with by replacing “myenv” with the name of your environment and adjusting the python version at the end of the path if necessary.

.conda/envs/myenv/bin/python3 -m ipykernel install --name 'myenv' --display-name "displayname" --user

To remove the myenv environment, the command is:

jupyter kernelspec uninstall myenv

To install a package, superpackage for example, to the example environment myenv that you created and added to the JupyterHub open a new python console on JupyterHub by selecting the myenv 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.1645098960.txt.gz
  • Last modified: 2022/02/17 11:56
  • by lukab