Python Package Management on SeaWulf

Python Package Management

SeaWulf supports multiple methods for managing Python packages and environments. The best option depends on your workflow, whether you need isolated environments, precompiled packages, or integration with system software.

When to Use Each Tool

  • Conda – Recommended for most users. Supports binary packages, easy dependency management, and reproducible environments.
  • venv – Lightweight built-in environment manager. Best for small or personal projects that only use pip.
  • pip – Installs individual packages inside an existing environment (Conda or venv). Not ideal for managing environments alone.

Note: Avoid installing packages into system-wide Python modules. Always use Conda or venv to keep environments isolated and consistent.

Quick Reference: Conda vs venv vs pip

Tool Use Case Advantages Example
Conda General scientific computing, large dependencies (NumPy, TensorFlow, etc.) Precompiled binaries, cross-language support, easy environment export conda create -n myenv python=3.10
venv Lightweight projects, personal scripts Uses system Python, built-in to Python 3 python3 -m venv myenv
pip Adding packages to an existing environment Simple and widely supported pip install requests

Example Usage

Using Conda

Load the Anaconda module, create a new environment, and install your desired packages:

# Load Conda module
module load anaconda3

# Create and activate environment
conda create -n analysis python=3.10
conda activate analysis

# Install packages
conda install numpy scipy matplotlib

For more details, see the Conda Environments page.

Using venv

Create and activate a lightweight Python-only environment with venv:

# Create environment
python3 -m venv myenv

# Activate
source myenv/bin/activate

# Install packages
pip install numpy scipy matplotlib

Best Practices

  • Use module load anaconda3 before creating or activating environments.
  • Store environments in $HOME or your project directory.
  • Document your dependencies with conda env export > environment.yml.
  • Avoid mixing pip and conda installations unless necessary.