Skip to content

Installation

Requirements

JAFF requires python>=3.. Check your Python version:

python --version

Installation

Managing virtual environments

Although JAFF can be installed in a variety of ways, it is encouraged to use uv to install JAFF and manage its virtual environment.

We recommend installing JAFF inside a virtual environment to avoid conflicts with other packages.

1. Create and activate a virtual environment

# Create virtual environment
python -m venv .venv

# Activate (Linux/macOS)
source .venv/bin/activate

# Activate (Windows)
.venv\Scripts\activate
# Create conda environment
conda create -n jaff python=3.11

# Activate
conda activate jaff
# Create virtual environment (faster)
uv venv

# Activate (Linux/macOS)
source .venv/bin/activate

# Activate (Windows)
.venv\Scripts\activate

2. Install from source

# Clone the repository
git clone https://github.com/jaff-chemistry/jaff.git
cd jaff

# Install the package
pip install -e .
# Clone the repository
git clone https://github.com/jaff-chemistry/jaff.git
cd jaff

# Install the package
uv pip install -e .

Verifying Installation

After installation, verify that JAFF is working correctly:

# Check JAFF version
python -c "import jaff; print(jaff.__version__)"

# Test the code generator CLI
jaffgen --help

You should see the JAFF code generator help message.

Available Commands

After installation, JAFF provides the following command-line tools:

  • jaffx - Quick command executor
jaffx export hdf5 --network networks/demos/demo1.jet --file demo.hdf5
  • jaffgen - Code generator for chemical reaction networks
jaffgen --network networks/demos/demo1.jet --template microphysics

Troubleshooting

ImportError: No module named 'jaff'

Make sure you've activated your virtual environment and that the installation completed successfully.

NumPy/SciPy Installation Issues

On some systems, if you are using pip, you may need to install NumPy, SciPy, and Astropy separately:

# Install scientific stack first
pip install numpy scipy astropy

Updating JAFF

JAFF is installed from source, so update by pulling the latest changes and reinstalling:

cd jaff
git pull
pip install -e .
cd jaff
git pull
uv pip install -e .

Uninstalling

To remove JAFF from your system/venv:

pip uninstall jaff
uv pip uninstall jaff

Next Steps

Now that JAFF is installed: