Skip to main content
Pixi activates environments differently than conda, providing a more streamlined experience that doesn’t require modifying shell configuration files.

How Pixi Shell Works

The pixi shell command launches a fresh shell with the environment activated, instead of modifying your current shell like conda activate.
To exit, simply close the shell:

Activation Mechanism (Unix)

On Unix systems, pixi creates a “fake” PTY session:
  1. Launches a new shell process
  2. Sends an activation command to stdin: source /tmp/activation-env-12345.sh
  3. Waits for PIXI_ENV_ACTIVATED echo to confirm success
  4. If no confirmation after 3 seconds, issues a warning

Automatic Shell Completions

Shell completions for tools in your environment are loaded automatically:
To disable:

Environment Variables Set by Pixi

Pixi sets these variables when running pixi run, pixi shell, or pixi shell-hook:
string
The root directory of the project
string
The name of the project from the manifest
string
Path to the manifest file (pixi.toml or pyproject.toml)
string
The version of the project
string
The prompt to use in the shell
string
default:"default"
Name of the active environment
string
Comma-separated list of platforms supported by the project
string
Path to the environment (conda compatibility)
string
Name of the environment (conda compatibility)
string
Prepended with environment’s bin directory
string
ONLY in pixi run: Directory where command was run from
These variables cannot be overridden by users. For example, setting PIXI_PROJECT_ROOT in your environment won’t change where pixi looks for the project.

Environment Variable Priority

Variables are set with the following priority (highest to lowest):

Example 1: task.env > activation.env

The task environment variable wins.

Example 2: activation.env > activation.scripts

setup.sh
The manifest activation.env wins over activation scripts.

Example 3: activation.scripts > dependency scripts

local_setup.sh
Local activation scripts override dependency scripts.

Example 4: dependency scripts > outside variables

Dependency activation scripts override outside environment.

Example 5: Complete Priority Chain

app_setup.sh
The task environment variable has the highest priority.
In older versions of pixi, this priority was not well-defined. If you’re upgrading from an old version, review your environment variable usage.

Activation Cache (Experimental)

Cache environment activation to speed up repeated pixi run and pixi shell invocations.

Enable Activation Cache

Cache Structure

Cache files are stored in .pixi/activation-env-v0/:

Cache Contents

The hash includes:
  • Lock file data for the environment
  • activation.scripts from manifest
  • activation.env from manifest

Force Reactivation

Ignore the cache and force full activation:
Or configure globally:
This is experimental because cache invalidation is complex. Use with caution in production environments.

Common Issues with Pixi Shell

Some shell configurations can interfere with pixi’s activation mechanism.

WSL Issue

~/.bashrc
The wsl.exe command takes over stdin and prevents activation.

Alternative Shell in bashrc

~/.bashrc
If you want to start an alternative shell, do so from ~/.bash_profile or ~/.profile instead of ~/.bashrc.

Alternative: Shell Hook

If pixi shell doesn’t work due to the issues above, use pixi shell-hook:

Bash/Zsh

~/.bashrc or ~/.zshrc

Fish

~/.config/fish/config.fish

PowerShell

$PROFILE
This provides conda-style activation without the PTY mechanism.

Customizing the Prompt

By default, pixi adds (pixi) to your shell prompt.

Disable Prompt Modification

Or via CLI:

Custom Prompt

The PIXI_PROMPT variable contains the prompt prefix:
Use in your custom prompt:
~/.bashrc

Best Practices

  1. Use pixi run for tasks instead of manually activating environments
  2. Use pixi shell for interactive work when you need environment access
  3. Avoid modifying PIXI_ variables* as they’re managed by pixi
  4. Document activation scripts to help team members understand environment setup
  5. Test activation after adding new activation scripts
  6. Use shell-hook if pixi shell doesn’t work with your shell configuration
  7. Enable activation cache for large projects to improve performance
Don’t mix conda activate and pixi shell in the same shell session. They use different activation mechanisms and can conflict.