Skip to main content
The pixi remove command removes dependencies from your workspace manifest and updates the lock file.

Usage

Arguments

string
required
The dependency to remove. Can be:
  • Package name: numpy
  • Multiple packages: numpy pandas scipy
Multiple packages can be specified.

Options

Dependency Type

boolean
default:"false"
Remove a PyPI dependency instead of conda. Conflicts with --host and --build.
boolean
default:"false"
Remove a host dependency. Conflicts with --build and --pypi.
boolean
default:"false"
Remove a build dependency. Conflicts with --host and --pypi.

Platform-Specific

string
Remove dependency for specific platform(s). Can be specified multiple times.Short flag: -p

Feature-Specific

string
default:"default"
Remove dependency from a specific feature.Short flag: -f

Update Options

Skip Installation

boolean
default:"false"
Don’t reinstall the environment, only update the lock file.

Lock File Usage

boolean
default:"false"
Don’t update the lock file.Env: PIXI_FROZEN
boolean
default:"false"
Require lock file to be up-to-date.Env: PIXI_LOCKED

Examples

Remove Single Package

Before:
After:

Remove Multiple Packages

Remove PyPI Package

Before:
After:

Remove from PyProject.toml

For pyproject.toml manifests, pixi remove --pypi removes from: Default feature: project.dependencies
Before:
After:
Named feature: dependency-groups or tool.pixi.pypi-dependencies
Before:
After:

Remove Platform-Specific Package

Before:
After:

Remove from Feature

Before:
After:

Remove Build Dependency

Before:
After:

Combining Options

Platform + Feature

Removes cuda from the gpu feature on linux-64 platform only.

Multiple Platforms

Removes numpy from both specified platforms.

PyPI + Feature

Removes PyPI pytest from the test feature.

Global Options

string
Path to pixi.toml, pyproject.toml, or workspace directory.Short flag: -m

Behavior Details

Dependency Detection

Pixi automatically detects where the dependency is defined:
  1. Default dependencies ([dependencies])
  2. Platform-specific dependencies ([target.<platform>.dependencies])
  3. Feature dependencies ([feature.<name>.dependencies])
  4. PyPI dependencies ([pypi-dependencies])
  5. Build/host dependencies

Removing Unused Dependencies

Removing a package doesn’t remove its dependencies. Use pixi update to clean up:

Lock File Update

By default, pixi remove:
  1. Removes package from manifest
  2. Updates lock file
  3. Reinstalls environment
Use --no-install to skip reinstallation:

Exit Status

  • 0: Success
  • 1: Package not found in specified location
  • 1: Lock file update failed
  • 1: Installation failed

Troubleshooting

Package Not Found

Error: package 'numpy' not found in dependencies Solutions:
  1. Check if package exists:
  1. Check feature/platform:
  1. Check if it’s a PyPI package:

Dependency Still Required

Warning: Other packages may still depend on the removed package. Solution: Check dependencies:
The package will remain in the lock file if other packages need it.

Lock File Out of Sync

Error: lock file is out of sync Solution:

Removing from Wrong Location

If removing doesn’t work, the package might be in:
  • Different feature: Try --feature <name>
  • Different platform: Try --platform <platform>
  • PyPI section: Try --pypi
  • Build section: Try --build
Inspect manifest to find exact location:

Common Workflows

Clean Up Test Dependencies

Remove Platform-Specific CUDA

Remove All PyPI Dev Tools

Switch from Conda to PyPI Package

See Also