Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML
<div style="background-color: yellow; border: 2px solid red; margin: 4px; padding: 2px; font-weight: bold; text-align: center;">
The Delta documentation has moved to <a href="https://docs.ncsa.illinois.edu/systems/delta/">https://docs.ncsa.illinois.edu/systems/delta/</a>. Please update any bookmarks you may have.
<br>
Click in the link above if you are not automatically redirected in 5 seconds.
</br>
</div>
<meta http-equiv="refresh" content="5; URL='https://docs.ncsa.illinois.edu/systems/delta/'" />


Table of Contents

Customizing Jupyterlab with Anaconda environments

...

Code Block
titleconda init bash
[arnoldg@dt-login03 scripts]$ module load anaconda3_cpu
[arnoldg@dt-login03 scripts]$ conda init bash
...
[arnoldg@dt-login03 scripts]$ 
[arnoldg@dt-login03 scripts]$ bash
(base) 

After you have run "conda init bash" you will not need to load anaconda3_cpu  (or gpu ) modules again.  Just use your new custom environment.

Info
titleconda init bash error messages

You may see error messages from conda init bash above.  Just control-c through them and continue.  As long as conda added code to the end of your .bashrc (or similar for other shells), things will work properly.

...

Install jupyter into the environment in order to use it with OpenOnDemand.  This option adds about 150 python modules to your environment and requires about 1.3 GB in your $HOME.  Setup time: about 10 minutes.

Code Block
titleconda create --name mynewenv
(base) conda create --name mynewenv

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /u/arnoldg/.conda/envs/mynewenv

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate mynewenv
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Retrieving notices: ...working... done
(base) conda activate mynewenv
(mynewenv) conda install jupyter
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /u/arnoldg/.conda/envs/mynewenv

  added / updated specs:
    - jupyter


The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main None
  _openmp_mutex      pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu None
  anyio              pkgs/main/linux-64::anyio-3.5.0-py310h06a4308_0 None
  argon2-cffi        pkgs/main/noarch::argon2-cffi-21.3.0-pyhd3eb1b0_0 None
...
(mynewenv) conda list | grep jupyter
jupyter                   1.0.0           py310h06a4308_8  
jupyter_client            7.3.5           py310h06a4308_0  
jupyter_console           6.4.3              pyhd3eb1b0_0  
jupyter_core              4.11.1          py310h06a4308_0  
jupyter_server            1.18.1          py310h06a4308_0  
jupyterlab                3.4.4           py310h06a4308_0  
jupyterlab_pygments       0.1.2                      py_0  
jupyterlab_server         2.15.2          py310h06a4308_0  
jupyterlab_widgets        1.0.0              pyhd3eb1b0_1  
(mynewenv) conda list | wc -l
152
(mynewenv) du -sh $HOME/.conda/envs/mynewenv
1.3G    /u/arnoldg/.conda/envs/mynewenv

...

Change your kernel to match if you are opening a notebook from a different environment.

R

R is available via in Jupyterlab by activating the environment for it from your preferred conda module.   Your bash shell should be setup with "conda init bash" as above.  Then append to your .bashrc, the line to activate the R environment.  We've provided a conda environment at /sw/external/python/anaconda3_Rcpu that you should be able to use with any of anaconda3_<cpu,gpu,mi100>.  It will run R via the module anaconda_Rcpu.   Append the module load line to your  .bashrc.   R will run on the cpu cores (not gpu enabled).

Code Block
titledelta provided R environment
(/sw/external/python/anaconda3_Rcpu)$ tail -4 .bashrc
# <<< conda initialize <<<

conda activate /sw/external/python/
module load anaconda3_Rcpu

(/sw/external/python/anaconda3_Rcpu) $

After modifying your .bashrc and getting a new shell, your login prompt should reflect that you are in an R python within the anaconda3_Rcpu environment, R will be in your $PATH, and starting Jupyterlab from the OpenOnDemand interface will automatically offer you the R options with the Launcher.

...

For internal staff debugging (also useful for new OOD users: debugging jupyterlab , OpenOnDemand)