python and conda

Miniforge Installation

An easy and flexible way to use Python is through Miniforge (a lightweight version of Conda-Forge). This allows users to have a fully-featured Python environment under their own control. Below is an example of how to set up Miniforge in the user's home directory.

$ wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" $ bash Miniforge3-$(uname)-$(uname -m).sh # During the installation, ***do NOT init***, as we will do it properly later. You can undo this by running `conda init --reverse $SHELL`? [yes|no] [no] >>> no # To use the conda command, you need to add the ~/miniforge3/condabin directory to # the PATH environment variable. Some old guides use "conda init" but it seems to point # conda not mamba. To setup mamba properly: $ ~/miniforge3/condabin/mamba init # Prevent auto activate the base env. True this is confusing, you need to use conda # here. $ conda config --set auto_activate_base false

The use of Miniforge/Conda may consume lots of disk space (for installed packages and downloaded cache). Please watch out for your home directory space quota.

CSG Managed Miniforge

A CSG-managed Miniforge installation is also available at the following path:

/share/apps/noarch/miniforge3/

This central installation provides popular and commonly used environments, ready for immediate use by everyone. It helps avoid duplication and conserves users' disk space.

$ /share/apps/noarch/miniforge3/condabin/mamba env list # conda environments: # /import/reed/8/z3155686/miniforge3 /import/reed/8/z3155686/miniforge3/envs/dice /import/reed/8/z3155686/miniforge3/envs/discourse base /share/apps/noarch/miniforge3 pytorch_cu118 /share/apps/noarch/miniforge3/envs/pytorch_cu118 pytorch_cu121 /share/apps/noarch/miniforge3/envs/pytorch_cu121

The Miniforge environment specification files are managed via Git: miniforge3_env.git. If you'd like to share your environment, please contact us, and we can add it to the managed Miniforge.