This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
biac:cluster:modules [2023/03/15 14:45] cmp12 |
biac:cluster:modules [2023/03/15 17:56] cmp12 [Setting Up Experiment Specific Conda Environments] |
||
---|---|---|---|
Line 134: | Line 134: | ||
~/ | ~/ | ||
</ | </ | ||
+ | |||
+ | |||
+ | ====== Setting Up Experiment Specific Conda Environments ====== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | First, you want to unload the default python3 and load miniconda via modules to begin: | ||
+ | < | ||
+ | [cmp12@blade29 ~]$ module unload python3 | ||
+ | [cmp12@blade29 ~]$ module load miniconda | ||
+ | |||
+ | [cmp12@blade29 ~]$ conda --version | ||
+ | conda 22.11.1 | ||
+ | |||
+ | #set the default location to download packages to TMPDIR so you do not fill up your home directory | ||
+ | [cmp12@blade29 ~]$ export CONDA_PKGS_DIRS=${TMPDIR}/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | Now, create your environment in a mounted location. | ||
+ | |||
+ | < | ||
+ | conda create -p / | ||
+ | |||
+ | #activate it | ||
+ | conda activate / | ||
+ | |||
+ | #install some of the python modules you may need | ||
+ | (/ | ||
+ | / | ||
+ | |||
+ | (/ | ||
+ | |||
+ | #verify | ||
+ | (/ | ||
+ | / | ||
+ | |||
+ | |||
+ | (/ | ||
+ | ipython==8.11.0 | ||
+ | jedi==0.18.2 | ||
+ | matplotlib-inline==0.1.6 | ||
+ | nibabel==5.0.1 | ||
+ | numpy==1.24.2 | ||
+ | ....... | ||
+ | </ | ||
+ | |||
+ | Now you have a consistent environment that you can use/ | ||
+ | |||
+ | To deactivate just run "conda deactivate" | ||
+ | |||
+ | To make it consistent, you can modify your ~/ | ||
+ | |||
+ | < | ||
+ | module remove python3 | ||
+ | module add miniconda | ||
+ | |||
+ | conda activate / | ||
+ | </ | ||
+ | |||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | < | ||
+ | | ||
+ | Python 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] on linux | ||
+ | Type " | ||
+ | >>> | ||
+ | >>> | ||
+ | ' | ||
+ | >>> | ||
+ | '// | ||
+ | </ | ||
+ | |||
+ | Add something else to your environment ( like R ): | ||
+ | < | ||
+ | (/ | ||
+ | |||
+ | #if you don't see the version you want you can add additional channels | ||
+ | conda config --add channels conda-forge | ||
+ | conda config --set channel_priority strict | ||
+ | |||
+ | #then search again | ||
+ | conda search r-base | ||
+ | |||
+ | |||
+ | #install the version you would like to use | ||
+ | (/ | ||
+ | |||
+ | (/ | ||
+ | / | ||
+ | |||
+ | (/ | ||
+ | R version 4.2.2 (2022-10-31) -- " | ||
+ | Copyright (C) 2022 The R Foundation for Statistical Computing | ||
+ | Platform: x86_64-conda-linux-gnu (64-bit) | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | |||