Pixi is a modern package manager that simplifies the installation of scientific software. It’s built on top of the conda-forge ecosystem but is significantly faster and provides better dependency resolution.
Why Pixi?
- Fast: 5-10x faster than conda for most operations
- Reproducible: Uses lock files to ensure exact environment reproduction
- Task Runner: Built-in task management (like npm scripts)
- Modern Design: Clean CLI with better error messages
- Conda Compatible: Uses the conda-forge repository
Installation
Follow the installation instructions on the official Pixi website. The installer will set up Pixi and configure your PATH automatically.
Getting Started
Initialize a new project:
pixi init
pixi add python
pixi shell
Add packages:
pixi add numpy pandas matplotlib
Define and run tasks in pixi.toml:
[tasks]
dev = "python main.py"
test = "pytest tests/"
Run tasks:
pixi run dev
pixi run test
Advantages Over Conda
- Much faster package resolution and installation
- Lock files ensure reproducibility by default
- Better support for managing multiple projects
- Built-in task runner eliminates need for separate tools
Tips
- Use
pixi shellto activate the environment - Define common tasks in
pixi.tomlfor easy project workflows - Lock files (
pixi.lock) should be committed to version control - Use
pixi global installfor system-wide tools