pixi init command creates a new pixi workspace with a manifest file and optional helpers.
Usage
Arguments
Where to place the workspace. Defaults to current directory.
Options
Channel Configuration
Channel to use in the workspace. Can be specified multiple times.Short flag:
-cPlatform Configuration
Platforms that the workspace supports. Can be specified multiple times.Short flag:
-plinux-64osx-64(macOS Intel)osx-arm64(macOS Apple Silicon)win-64linux-aarch64
Manifest Format
The manifest format to create.Options:
pixi: Createspixi.tomlpyproject: Createspyproject.tomlmojoproject: Createsmojoproject.toml
The
--format option is case-insensitive.Import Environment
Environment.yml file to bootstrap the workspace. Converts a conda environment to pixi.Short flag:
-iSource Control Management
Source Control Management system to configure. Creates appropriate
.gitignore and CI templates.Short flag: -sOptions:github: GitHub-specific configurationgitlab: GitLab-specific configurationcodeberg: Codeberg-specific configuration
The
--scm option is case-insensitive.Conda-PyPI Mapping
Set a mapping between conda channels and PyPI indexes. Can be specified multiple times.Format:
CHANNEL=PYPI_INDEXExamples
Basic Initialization
Create a new workspace in the current directory:pixi.tomlwith default configuration.gitignore(if not present)
Initialize in Specific Directory
Python Project with PyPI
Create a pyproject.toml-based project:pyproject.toml:
Multi-Platform Project
pixi.toml:
Machine Learning Project
pixi.toml:
Import from Conda Environment
Convert an existingenvironment.yml:
environment.yml
pixi.toml:
Bioinformatics Project
Configuration File
The default channels can be configured globally:~/.pixi/config.toml
pixi init will use these channels by default:
Conflicts
Certain options conflict with each other:--importconflicts with--channel(channels come from environment.yml)--importconflicts with--format(format is determined from import)--formatconflicts with deprecated--pyprojectflag
Deprecated Options
Project Structure
After initialization, your workspace contains:Global Options
The path to
pixi.toml, pyproject.toml, or the workspace directory.Short flag: -mEnvironment Variables
No environment variables affectpixi 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
- pixi add - Add dependencies to the project
- pixi install - Install the environment
- Global Configuration - Configure default channels