Requirements
Zuko requires:- Python: 3.10 or higher
- PyTorch: 1.12.0 or higher
- NumPy: 1.20.0 or higher
Zuko is built on top of PyTorch and leverages its distribution and transformation primitives. Make sure you have PyTorch installed before installing Zuko.
Installation Methods
Install from PyPI (Recommended)
The easiest way to install Zuko is via pip from PyPI:This will install the latest stable release along with all required dependencies.
Install from Source (Latest Features)
If you need the latest features that haven’t been released yet, install directly from the GitHub repository:
Installing from source gives you access to the latest development features, but may be less stable than the PyPI release.
Verify Installation
After installation, verify that Zuko is installed correctly:GPU Support
Zuko automatically leverages PyTorch’s GPU support. If you have a CUDA-capable GPU, you can move flows to GPU just like any PyTorch module:Optional Dependencies
Zuko has several optional dependency groups:| Group | Install Command | Purpose |
|---|---|---|
dev | pip install zuko[dev] | Development tools (pre-commit, ruff, matplotlib) |
docs | pip install zuko[docs] | Documentation building (sphinx, myst-nb) |
test | pip install zuko[test] | Testing framework (pytest) |
Common Issues
PyTorch version mismatch
PyTorch version mismatch
If you encounter issues with PyTorch compatibility:
Import errors after installation
Import errors after installation
If you can’t import Zuko after installation:
CUDA/GPU issues
CUDA/GPU issues
If you have problems with GPU acceleration:Make sure you have the CUDA-enabled version of PyTorch installed. See PyTorch installation guide for details.
What’s Next?
Now that you have Zuko installed, you’re ready to build your first normalizing flow!Quickstart Tutorial
Learn how to create and train a normalizing flow in just a few minutes
