Usage
Description
Thepixi lock command updates the lockfile (pixi.lock) based on your manifest (pixi.toml or pyproject.toml) without installing packages into environments. This is useful when you want to:
- Update package versions in the lock file
- Verify that dependencies can be resolved
- Prepare for installation on another machine
- Run in CI to check for dependency conflicts
Options
Update lock file for specific environment(s). Can be specified multiple times.
Update lock file for specific platform(s). Can be specified multiple times.
Don’t install the environment after updating the lock file (deprecated, this is now the default behavior).
Examples
Update Lock File for All Environments
Update Specific Environment
Update Multiple Platforms
Check if Lock File is Up to Date
Lock File Behavior
The lock file (pixi.lock) contains:
- Exact package versions for all dependencies
- Package URLs and checksums
- Platform-specific package selections
- Dependency graph for each environment
The lock file should be committed to version control to ensure reproducible builds across different machines and CI environments.
Common Use Cases
CI/CD Pipeline
Before Installing on Another Machine
--frozen flag with pixi install ensures it uses the exact versions from the lock file.
After Changing Dependencies
Related Commands
pixi install- Install environments from the lock filepixi update- Update dependencies and lock filepixi upgrade- Upgrade dependencies to newer versions