Choosing a tool

ToolPrimary purposeKey benefitsSample command
Conda (recommended)Scientific work with substantial dependenciesPrecompiled binaries, cross-language, environment exportconda create -n myenv python=3.10
venvSmaller projects, personal utilitiesUses system Python, built into Python 3python3 -m venv myenv
pipAdding packages to an existing environmentStraightforward, broadly compatiblepip install requests
Avoid: Do NOT use pip install --user to install directly into your home directory โ€” use conda or venv to keep proper isolation.

Conda workflow

module load anaconda/3
conda create -n analysis python=3.10
conda activate analysis
conda install numpy scipy matplotlib

venv workflow

python3 -m venv myenv
source myenv/bin/activate
pip install numpy scipy matplotlib

Recommendations

  • Load anaconda before any environment operations
  • Keep environments within $HOME or project directories
  • Export dependencies: conda env export > environment.yml
  • Minimize mixing pip and conda in the same environment
Applies to All clusters