Conda Environments

Conda Environments

Overview

Anaconda is an open-source platform designed for managing and deploying software, particularly for data science and research applications. Conda simplifies package management and helps avoid conflicts between software versions by creating isolated environments.

Using Conda environments ensures your projects have the specific libraries they need for reproducible research.

Loading Anaconda

# Load the Anaconda module
module load anaconda/3
    

Creating a Conda Environment

You can create custom Conda environments either by name or by specifying a directory:

By Name

conda create --name env-name
    

This creates the environment in /gpfs/home/NETID/.conda/envs/env-name

By Directory

conda create --prefix /path-to-env/env-name
    

This creates the environment in the specified directory. You cannot combine --name and --prefix; choose one method.

Activating and Using the Environment

# Activate the environment
conda activate env-name

# Install packages
conda install numpy pandas matplotlib

# Deactivate when done
conda deactivate
    

Best Practices

  • Install environments in your home directory or a project space to avoid quota issues.
  • Use separate environments for different projects to ensure reproducibility.
  • Check your environment before submitting jobs to ensure required packages are installed.

Tip: For more details on managing Conda environments on SeaWulf, see the full guide: Creating and Using Conda Environments.