Skip to main content
Pixi supports multiple environments within a single workspace, allowing you to manage different dependency sets, Python versions, and system requirements in one project. This is powerful for testing, development, and production scenarios.

Why Multiple Environments?

Multiple environments solve many real-world scenarios:
Test your code against different versions:
Create focused environments for specific tasks:
Combine multiple features into one development environment:
Test production with additional dependencies:
Support different hardware in one workspace:

Features and Environments

Pixi uses features to define environment components. Features can specify:
  • dependencies - Conda packages
  • pypi-dependencies - PyPI packages
  • system-requirements - System specifications
  • activation - Activation scripts and env vars
  • platforms - Supported platforms
  • channels - Package channels (with priority)
  • target - Platform-specific configuration
  • tasks - Feature-specific tasks

The Default Feature

All base configuration is part of the default feature:

Defining Features

Create custom features for different purposes:
Channels in features concatenate using priority (higher priority comes first). Default channels are still used.

Creating Environments

Combine features to create environments:
The default feature is automatically included unless you set no-default-feature = true.

Environment Without Default

Create isolated environments that don’t include base dependencies:

Solve Groups

Solve groups ensure multiple environments share compatible package versions:
Use solve groups when you want to test a production environment with additional dependencies but ensure package versions remain identical.

Using Environments

Default Environment

Specific Environment

Default Environment for Tasks

Set which environment runs a task by default:

Ambiguous Task Selection

When a task exists in multiple environments, Pixi prompts for selection:
Tasks defined in features override tasks in the default environment.

Lock File Structure

The lock file tracks which environments use which packages:
Packages can list multiple environments, keeping the lock file minimal.

Real-World Examples

Python Version Matrix Testing

CI configuration:

Production vs Testing

Usage:

Multi-Hardware Support

From the multi-machine example:

Package Version Testing

Best Practices

Keep Features Focused
Use Solve Groups for Production
Document Environment Purpose
Use no-default-feature for Tools