Quick Examples
- pixi add
- pixi global
- pixi exec
Conda Package Specifications
Pixi uses the conda MatchSpec format for specifying conda package requirements.Basic Version Specifications
Simple version constraints:Version Operators
Full MatchSpec Syntax
For precise control over package variants, use the full MatchSpec syntax:Command Line Syntax
Equals syntax (compact):Both syntaxes are equivalent - use whichever is clearer for your use case.
TOML Mapping Syntax
Inpixi.toml, use the mapping syntax for complete control:
- version - Version constraint with operators
- build - Build string pattern with wildcards
- build-number - Build number constraint
- channel - Channel name or URL
- sha256/md5 - Package checksums
- license - Expected license
- file-name - Specific package file
Build Strings
Build strings identify specific builds of the same package version, especially for:- Hardware acceleration - CPU vs GPU/CUDA builds
- Python versions - Different Python interpreter builds
- Compiler variants - Different compiler versions
py311h43a39b2_0
py311- Python version indicatorh43a39b2- Build configuration hash_0- Build number
Common Build Patterns
Build Numbers
Build numbers increment when a package is rebuilt with the same version:When to use build numbers
When to use build numbers
Use build numbers when:
- A package was rebuilt to fix compilation issues
- You need a specific rebuild with bug fixes
- Creating reproducible environments requiring exact builds
Channels
Channels are repositories where conda packages are hosted:Package Checksums
Verify package integrity with checksums:- Verifies downloaded packages match the checksum
- Fails installation if checksums don’t match
- Ensures you get the exact package expected
Source Packages
Path-Based Sources
Git-Based Sources
- git - Repository URL
- branch - Branch name
- tag - Git tag
- rev - Specific commit SHA
- subdirectory - Path within repository