Skip to main content
The pixi init command creates a new pixi workspace with a manifest file and optional helpers.

Usage

Arguments

string
default:"."
Where to place the workspace. Defaults to current directory.

Options

Channel Configuration

string
default:"conda-forge"
Channel to use in the workspace. Can be specified multiple times.Short flag: -c

Platform Configuration

string
Platforms that the workspace supports. Can be specified multiple times.Short flag: -p
Common platforms:
  • linux-64
  • osx-64 (macOS Intel)
  • osx-arm64 (macOS Apple Silicon)
  • win-64
  • linux-aarch64

Manifest Format

enum
default:"pixi"
The manifest format to create.Options:
  • pixi: Creates pixi.toml
  • pyproject: Creates pyproject.toml
  • mojoproject: Creates mojoproject.toml
The --format option is case-insensitive.

Import Environment

string
Environment.yml file to bootstrap the workspace. Converts a conda environment to pixi.Short flag: -i

Source Control Management

enum
Source Control Management system to configure. Creates appropriate .gitignore and CI templates.Short flag: -sOptions:
  • github: GitHub-specific configuration
  • gitlab: GitLab-specific configuration
  • codeberg: Codeberg-specific configuration
The --scm option is case-insensitive.

Conda-PyPI Mapping

string
Set a mapping between conda channels and PyPI indexes. Can be specified multiple times.Format: CHANNEL=PYPI_INDEX

Examples

Basic Initialization

Create a new workspace in the current directory:
This creates:
  • pixi.toml with default configuration
  • .gitignore (if not present)

Initialize in Specific Directory

Python Project with PyPI

Create a pyproject.toml-based project:
Resulting pyproject.toml:

Multi-Platform Project

Resulting pixi.toml:

Machine Learning Project

Resulting pixi.toml:

Import from Conda Environment

Convert an existing environment.yml:
environment.yml
Resulting pixi.toml:

Bioinformatics Project

Configuration File

The default channels can be configured globally:
~/.pixi/config.toml
Now pixi init will use these channels by default:

Conflicts

Certain options conflict with each other:
  • --import conflicts with --channel (channels come from environment.yml)
  • --import conflicts with --format (format is determined from import)
  • --format conflicts with deprecated --pyproject flag

Deprecated Options

The --pyproject flag is deprecated. Use --format pyproject instead.

Project Structure

After initialization, your workspace contains:

Global Options

string
The path to pixi.toml, pyproject.toml, or the workspace directory.Short flag: -m

Environment Variables

No environment variables affect pixi init.

Common Workflows

Start a New Python Project

Convert Conda Project to Pixi

Multi-Environment Setup

pixi.toml

Troubleshooting

Directory Already Exists

Error: directory 'my-project' already exists Solution: Use a different name or initialize in the existing directory:

Invalid Channel Name

Error: invalid channel name Solution: Check channel name spelling and availability:

Import File Not Found

Error: environment.yml not found Solution: Provide full path to environment file:

See Also