Installing Pixi
A simple guide to install Pixi and create a basic project.
Install Pixi
https://pixi.prefix.dev/latest/installation/
macOS and Linux
curl -fsSL https://pixi.sh/install.sh
Create a folder
mkdir my-project
cd my-project
Initialize pixi
pixi init
Add Python and Packages
Add python:
pixi add python
pixi add python=3.11
pixi add numpy pandas
Project Files
Pixi manages two important files:
-
pixi.toml – project configuration and dependency declarations
-
pixi.lock – exact resolved versions for reproducibility
Create and Activate the Environment
Create and activate the environment defined in pixi.toml:
pixi shell
Reproducible Dependencies (Time-Based)
To ensure packages are no newer than a certain date, use a dated channel snapshot in pixi.toml.
# in your pixi.toml
exclude-newer = "2023-02-01"
Update the Environment
After changing pixi.toml:
pixi install