Anaconda
Anaconda is a package management system and environment management system for installing multiple versions of software packages and their dependencies and switching between them.
The conda
command is available from many different applications. Some examples are miniconda, conda-forge, and mamba, however they are all different.
- Anaconda3: A full distribution with many pre-installed packages.
- Miniconda3: A minimal installer for conda, useful if you want to start with a clean slate and install only the packages you need.
- Conda Forge: A community driven distribution for conda by GitHub.
- Mamba: A faster alternative to conda for package management, compatible with conda environments.
New Anaconda3 Version
Starting 12/16/2024, the latest of Anaconda3 has been installed in the WI-HPC Cluster and is new the default. This may cause issues with environments built with the older version. To avoid any issues, we recommend that you rebuild your environments using the newest version. You may also (but not recommended) use the older version with module load Anaconda3/2022.05
.
Best Practices
- Only use the centrally installed version of Anaconda3, as this is the only version that IT will support. See Initializing Conda.
- NEVER install packages into the base environment, always create a new one. See Managing Environments.
- If you aren't sure what to do, reach out to the IT Help Desk via the Wistar Help Center
Using Anaconda
Anaconda3 is available via the module load Anaconda3
command. This the centrally installed version of conda
that is available to all users and the only version that IT will support. Some users choose to install conda
or similar versions in their home directory and/or lab share. IT will not support or help with Anaconda installed in other locations such as home directory or lab share.
Initializing Conda
To start using conda
, first load the module
module load Anaconda3
Then initialize conda. This command will modify you ~/.bashrc
so that the conda
command is available to you.
conda init
The conda
command will now be in your $PATH and available to use
conda --help
Log out and back in to ensure it is working correctly. By default, the (base)
conda environment will be activated. DO NOT install packages into the (base)
environment, rather create your own.
Creating Environments
To create a new environment use the conda create
command followed by the name of the environment and any packages you want to include. For example:
conda create --name my_env python=3.8
Managing Environments
To starting using an environment, use the conda activate
command
conda activate my_env
You can test that you environment is working correctly with:
which python
This should output something like:
~/.conda/envs/my_env/bin/python
Using conda
in scripts
To use conda
commands within sbatch
script you must add source ~/.bashrc
to your script, otherwise the conda
command will not be found.
To install additional packages to my_env
, use the conda install
command
conda install package_name
To deactivate an environment, use the conda deactivate
command
conda deactivate
To list your environments, use the conda envs
command
conda envs list
To remove an environment, use the conda remove
command along with the name
conda remove --name my_env
License Information
As of 2025, The Wistar Institute will now be requiring a license for all users using conda
in the WI-HPC cluster. If you would like to use a version installed in your lab share and/or home directory, users/labs will need to pay for this license on their own.
Once IT has onboarded your account, you will recieve an email to setup your account. After setting up your account you will need to verify you email address (use your @wistar.org email). Finally, click on Tokens -> Create Token and copy the token that is provided to you.
Login to the WI-HPC Cluster and ensure that you are using the centrally installed version of Anaconda3.
whereis conda
# This should output the following
conda: /applications/Anaconda3/2024.10/condabin/conda
If a different path is outputted, please change to using the centrally installed version of Anaconda. See Initializing Conda on how to switch.
Finally, set the Token
conda token set <paste token here>
If you have any questions and or concerns, please reach out the IT Help Desk via the Wistar Help Center