====== Anaconda ====== Anaconda is a free and open-source distribution of the Python. For better performances Anaconda python V3 et V2 are installed with Several optimized scientific packages. ===== Installed version ===== In console, check the available modules: $ module avail lang/python/anaconda lang/python/anaconda/2.7 lang/python/anaconda/3.7 lang/python/anaconda/3.8 load python version, for example: $ module load lang/python/anaconda/3.8 Check for installed packages: $ conda list ===== Install new package===== **EDIT DEC 2023**\\ If you get errors ( related to ''GLILBC'') when installing packages with ''conda'' please follow this [[anaconda_sing|link]]. **EDIT 2023**\\ The latest python version supported on the cluster is **3.7.4** You need to request this explicitly when creating a new conda env by using this option: ''python=3.7.4'' You may need to install additional package without having root access. We instead recommend building a ''virtual environment'' locally and install packages there. But before we need to tell conda to use ''WORK'' to store pkgs. Run commands below **only once** : $ conda config --add pkgs_dirs $WORK/.conda/pkgs $ conda config --add envs_dirs $WORK/.conda/envs - Create a conda environment $ conda create -y --prefix $WORK/conda-env python=3.7.4 replace ''conda-env'' by a valid name. - Activate the environment you just created $ conda activate $WORK/conda-env - Download and install the conda package in the environment $ conda install package replace package by the package you wan to install, for example ''panda'' - Run your analysis from **within** the environment - Deactivating environment, once you are done with your analysis- you can deactivate the conda environment by running the command $ conda deactivate ==== SGE Example using anaconda environement ==== Here is a simple SGE script that load anaconda 3.7, activate conda env called conda-env and then run a python program. #!/bin/bash #$ -q all.q #$ -l h_vmem=6G ## job will cancel if memory exceed #$ -N Test_anaconda module load lang/python/anaconda/3.7 ## load conda, activate env called conda-env and run conda program conda activate $WORK/conda-env && python conda_Program.py