Usage
Description
Thepixi clean command removes cached data and environments. It can clean:
- Workspace environments (
.pixifolder) - System-wide cache (conda packages, PyPI wheels, repodata, etc.)
- Build-related caches
Subcommands
pixi clean cache
Clean the global cache directory.
Options
Workspace Options
string
The specific environment directory to remove.
boolean
Only remove the activation cache.
boolean
Only remove the pixi-build cache.
Cache Options
boolean
Clean only the PyPI related cache.
boolean
Clean only the conda related cache.
boolean
Clean only the repodata cache.
boolean
Clean only the conda-pypi mapping cache.
boolean
Clean only the exec cache (cached command executions).
boolean
Clean only the build backends environments cache.
boolean
Clean only the build-related cache (git, work directories, built packages).
boolean
Answer yes to all prompts. Useful for automation.
Examples
Clean workspace environments
Remove all environments in the current workspace:- Environment directories (
.pixi/envs/) - Solve group environments
- Task cache
- Activation cache
- Workspace build cache
Clean specific environment
Remove only one environment:Clean activation cache only
Remove just the activation cache without removing environments:Clean all cache
Remove all cached data (interactive prompt):Clean specific cache types
Remove only PyPI cache:Clean multiple cache types
Combine flags to clean specific caches:Clean build caches
Remove build-related caches:Non-interactive cleaning
Clean without confirmation prompts:Cache Locations
By default, pixi caches data in:- Linux:
~/.cache/rattler/ - macOS:
~/Library/Caches/rattler/ - Windows:
%LOCALAPPDATA%\rattler\Cache
When to Clean
Disk space issues
Disk space issues
The cache can grow large over time. Use
pixi info --extended to check cache size, then clean unused caches.Corrupt cache
Corrupt cache
If you encounter strange package resolution or download errors, cleaning the repodata cache can help:
Fresh environment
Fresh environment
To recreate environments from scratch:
Build issues
Build issues
If builds are failing or producing unexpected results:
Package resolution changes
Package resolution changes
After changing channels or updating package sources:
Safety
Cleaning workspace environments does not affect the lock file. Running
pixi install will recreate the environments from the lock file.Related Commands
pixi info- View cache sizes with--extendedpixi install- Recreate environments after cleaning