jupyter
notebookThis document will guide you to create a conda
environment and run jupyter
notebooks in the adroit
cluster or your own computer. This should be sufficient to do most of the coding projects of APC 523.
adroit
is Princeton HPC cluster that can be used to run jupyter
notebook remotely through the new OnDemand web-based platform MyAdroit.
This guide will mainly use /bin/bash/
shell and python3
.
adroit
accountadroit
account, fill in the registration form.adroit
through either ssh
or MyAdroit.conda
in the cluster using module
command.
module load anaconda3/2021.11
Note that you need to specify the anaconda
version which you can check through module avail
command.
conda list
give the list of currently installed packages. You can check the current environment and the conda
version using conda info
command.
conda
environmentFor this course conda
environment provided in APC523.yml
should contain relevant packages to do most of the works.
conda
environment by invoking the create environment command.
conda env create -f [path_to_file]/APC523.yml
Wait until the installation is finishes as it might take a while.
conda activate APC523
conda remove --name APC523 --all
Verify that the environment is removed using conda info --envs
.
jupyter
notebook in clusterjupyter
notebook). If you are using jupyterlab
check the option Use JupyterLab instead of Jupyter Notebook? then click Launch.
jupyter
or jupyterlab
interface.
jupyter notebook
Select the kernel from our environment labeled as APC523
as the Notebook kernel when creating the notebook.
To change the current notebook kernel, click on Kernel > Change kernel and select a new kernel from the drop-down list.
jupyter lab
Select the kernel from our environment labeled as APC523
as the Notebook kernel when creating the notebook.
To confirm the current notebook kernel, it is displayed on the top right corner.
To change the current notebook kernel, click on the kernel name indicator and select a new kernel from the drop-down list.
Note that jupyterlab
extensions are not currently available through MyAdroit.
conda
locallyconda
package from its website.conda
command in your console.conda
environmentjupyter notebook
or jupyter lab
jupyterlab
extensionsIf you prefer to use jupyterlab
there are some widgets that can help and should be installed through the terminal after activating the environment. Here I am installing packages related to matplotlib
plotting module and collapsible_headings
.
jupyter labextension install @jupyter-widgets/jupyterlab-manager @aquirdturtle/collapsible_headings
jupyter lab build
jupyterlab_execute_time
extensionIncluded in the environment file is the jupyterlab_execute_time
package. This extension is useful to measure cell execution time.
To enable this in jupyterlab
insert {"recordTiming": true}
in Settings > Advanced Settings Editor > Notebook > User Preferences or in [jupyterlab User Settings directory]/@jupyterlab/notebook-extension/tracker.jupyterlab-settings
. Location of the jupyterlab
user setting file can be retrieved through the command jupyter lab path
.
For more information about this extension you can check in their GitHub page.