Quick Start Guide
This guide will walk you through creating your first Pixi workspace, adding dependencies, and running tasks. You’ll have a working project in under 5 minutes!Make sure you have installed Pixi before continuing.
Create Your First Workspace
A Pixi workspace is a directory with apixi.toml manifest file that defines your project’s dependencies, tasks, and environments.
1
Initialize a new workspace
Create a new workspace called This creates a new directory with the following structure:
my_workspace:2
Explore the manifest
The
pixi.toml file is your workspace’s manifest:Add Dependencies
Let’s add some Python packages to the workspace.1
Add Python and NumPy
- Adds dependencies to
pixi.toml - Solves all dependencies
- Creates/updates
pixi.lockwith exact versions - Installs packages into the environment at
.pixi/envs/default
pixi.toml now includes:2
Add more packages
Add pytest for testing:You can also specify exact versions:
Understanding the Lock File
Pixi automatically created apixi.lock file containing exact versions of all dependencies:
Run Commands in Your Environment
Now let’s use the packages we installed.1
Run a command directly
Use Try using NumPy:
pixi run to execute commands in the environment:2
Use the shell
Start an interactive shell in the environment:Your prompt will change to indicate you’re in the Pixi environment. Now you can run commands directly:Type
exit to leave the shell.Create and Run Tasks
Tasks are reusable commands defined in your manifest. They’re perfect for common operations like testing, building, or running your application.1
Create a Python script
Create a file called
hello.py:2
Add a task to run the script
pixi.toml:3
Run the task
Add More Complex Tasks
Tasks can have dependencies and arguments for more complex workflows.1
Add a test task
Create a simple test file Add a test task:
test_hello.py:2
Create a task with dependencies
Add this to your Now running
pixi.toml manually:pixi run run-all will execute all three tasks in order:Working with PyPI Packages
Pixi seamlessly integrates conda packages with PyPI packages.1
Add a PyPI package
Use the This adds to
--pypi flag to install from PyPI:pixi.toml:2
Use the PyPI package
Complete Example Workflow
Here’s a complete example putting it all together:Next Steps
Congratulations! You’ve learned the basics of Pixi. Here’s what to explore next:Multiple Environments
Learn how to manage development, testing, and production environments
Advanced Tasks
Discover powerful task features like arguments and templates
Global Tools
Install CLI tools system-wide with Pixi
Multi-Platform Support
Configure projects for Linux, macOS, and Windows
Common Workflows
Starting an Existing Project
If you clone a repository with apixi.toml: