Skip to main content
The pixi reinstall command reinstalls environments, updating the lockfile if needed and reinstalling packages from scratch.

Usage

Arguments

string
Specific package(s) to reinstall. If not provided, the entire environment is reinstalled.Multiple packages can be specified.

Behavior

Full Environment Reinstall

When no packages are specified, the entire environment is reinstalled:
This will:
  1. Update the lockfile if it’s out of date
  2. Remove all installed packages in the environment
  3. Reinstall all packages from the lockfile

Selective Package Reinstall

When specific packages are provided, only those packages are reinstalled:
This reinstalls only the specified packages and their dependencies.

Options

Environment Selection

string
The environment to reinstall. Can be specified multiple times to reinstall multiple environments.Short flag: -eDefaults to the default environment if not specified.

All Environments

boolean
default:"false"
Reinstall all environments in the workspace.Short flag: -aConflicts with --environment.
Use --all to reinstall every environment defined in your workspace in one command.

Lock File Options

boolean
default:"false"
Reinstall using the existing lock file without updating it.Env: PIXI_FROZEN
boolean
default:"false"
Check if lock file is up-to-date before reinstalling. Abort if not.Env: PIXI_LOCKED

Examples

Reinstall Default Environment

Reinstalls all packages in the default environment.

Reinstall Specific Environment

Reinstalls all packages in the “ml” environment.

Reinstall Multiple Environments

Reinstalls both “dev” and “test” environments.

Reinstall All Environments

Reinstalls every environment in the workspace.

Reinstall Specific Packages

Reinstalls only numpy, pandas, and matplotlib (and their dependencies) in the default environment.

Reinstall Package in Specific Environment

Reinstalls Python in the “prod” environment.

Reinstall Without Updating Lock

Reinstalls using the exact versions in the current lock file.

When to Use Reinstall

Corrupted Environment

If your environment is corrupted or packages are in an inconsistent state:

After System Changes

After system updates or when packages aren’t behaving correctly:

Testing Clean Installation

To verify that all dependencies install correctly from scratch:

Package Conflicts

When experiencing package conflicts or import errors:

Comparison with Other Commands

reinstall vs install

  • pixi install: Installs missing packages, keeps existing ones
  • pixi reinstall: Removes and reinstalls packages, ensuring clean state

reinstall vs update

  • pixi update: Updates packages to newer versions within constraints
  • pixi reinstall: Reinstalls current versions from lockfile

reinstall vs upgrade

  • pixi upgrade: Upgrades to latest versions, updating lockfile
  • pixi reinstall: Reinstalls without changing versions (unless lockfile is updated)

Global Options

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

Config Options

These options override global configuration:
  • --tls-no-verify: Disable TLS verification
  • --auth-file <FILE>: Path to authentication file
  • --pypi-keyring-provider <PROVIDER>: Keyring provider for PyPI

Troubleshooting

Environment Not Found

Error: environment 'xyz' not found Solution: Check available environments:

Lock File Out of Date

Error: lock file is out of date Solution: Update the lock file or use --frozen:

Package Not in Environment

Error: package 'xyz' not found in environment Solution: Verify the package is in the environment:

Performance Notes

Reinstalling specific packages is faster than reinstalling the entire environment.
For large environments:

See Also