Using Conda Environments on NAS Systems

Article ID: 557
Last updated: 17 Aug, 2026
WARNING: This article was recently updated with information about using conda environments on Grace Hopper nodes. Please note that because these nodes are fundamentally different from the other NAS node types, due to their Arm architecture, conda environments that were created to run on other NAS node types will not run on the Grace Hopper nodes. Therefore, you must create conda environments explicitly for the Grace Hopper nodes.

We provide multiple conda environments for you to use for your machine learning projects. The environments are available via the conda module in the /swbuild/analytix/tools/modulefiles directory.

All of the available environments include the basic machine learning packages, as well as common image processing and natural language processing packages. You can activate the environments via an interactive session or with a PBS batch job.

For a list of environments we currently provide, along with the packages they include, see Machine Learning: Overview.

Loading the Module and Activating the Environments in Interactive Mode

First, access and load the miniconda module, which provides access to the environment:

% module use -a /swbuild/analytix/tools/modulefiles
% module load miniconda3/v4

Then, activate one of the environments (where env_name is the name of the environment):

  • For bash: % source activate env_name
  • For csh: % source /swbuild/analytix/tools/miniconda3_220407/bin/activate.csh env_name

Loading Conda Environments for Use with Grace Hopper Nodes

Because the Grace Hopper nodes are fundamentally different from other NAS node types, due to their Arm architecture, conda environments that were created to run on other NAS node types will not run on the Grace Hopper nodes.

You can load a conda environment compatible with Grace Hopper nodes using the gh2 module. To load this module:

% module use -a /swbuild/analytix/tools/modulefiles
module load miniconda3/gh2

For a list of conda environments available for use with the Grace Hopper nodes, see Table 2 in Machine Learning: Overview.

Useful Conda Commands

After loading the module, you will have access to conda commands, including:

% conda info --envs
Shows available environments.
% conda list -n env_name
Shows installed packages within an environment.
(env_name)% conda deactivate
Deactivates an environment after loading.

For more detailed documentation, see the Conda website.

Using a PBS Batch Job to Activate an Environment

You can activate your machine learning environment, run your program, and deactivate the environment in a PBS script. For example:

#!/bin/bash -x 
#PBS -l select=1:model=mil_a100:ncpus=64:ngpus=4
#PBS -l place=scatter:excl 
#PBS -q gpu_normal

cd $PBS_O_WORKDIR

module purge

# load the module and environment
module use -a /swbuild/analytix/tools/modulefiles
module load miniconda3/v4
source activate env_name

# run python script
python test_cnn.py

# deactivate environment
conda deactivate

# end of script

For more detailed information about running your PBS job on the GPU nodes, see Requesting GPU Resources.

Requesting New or Missing Packages

If you need to use a specific package that is not currently installed in any of the environments, please send an email to support@nas.nasa.gov. In your email, provide the name of the package and request a ticket be opened with the Data Science team. We will help install the package into the existing environments or create a new environment if needed. You can also install your own packages or create your own conda environment.

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.