Skip to main content
Clean parts of your system touched by pixi.

Usage

Description

The pixi clean command removes cached data and environments. It can clean:
  • Workspace environments (.pixi folder)
  • 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:
This removes:
  • 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:
Remove conda package cache:
Remove repodata cache to force refresh:

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
Cache structure:

When to Clean

The cache can grow large over time. Use pixi info --extended to check cache size, then clean unused caches.
If you encounter strange package resolution or download errors, cleaning the repodata cache can help:
To recreate environments from scratch:
If builds are failing or producing unexpected results:
After changing channels or updating package sources:

Safety

Cleaning the cache will cause packages to be re-downloaded on next install. This is safe but may take time depending on your internet connection.
Cleaning workspace environments does not affect the lock file. Running pixi install will recreate the environments from the lock file.