Project Configration
Pixi supports two configuration files: pixi.toml
and pyproject.toml
known as the project manifest. Those files consist of different tables, where each table groups related configuration options. The files allow the user to keep one file with all configuration This documentation overviews the most important tables and their options. For more information see Pixi Project Configuration.
Project Table
This table must have the following options as the minimum requirement.
name: defines the project name.
channels: defines the list of channels used to fetch the packages from. If you want to use channels hosted on anaconda.org you only need to use the name of the channel directly.
platforms: determines which platforms are supported by the project. Pixi resolves dependencies for multiple platforms and stores them in the lock file (pixi.lock
).
[project]
name = "my-project"
channels = ["conda-forge"]
platforms = ["linux-64"]
For more options, see the project table.
Tasks Table
Tasks provide a way to automate specific custom commands within your project. In a Pixi project, tasks function as cross-platform shell commands, offering a consistent syntax regardless of the platform. For example, the following task prints "This is my simple task":
[task]
simple = "echo This is a simple task"
To run a task, use the pixi run
command:
$ pixi run simple
✨ Pixi task (simple): echo This is a simple task
This is a simple task
System-requirements
Table
It defines minimal system specifications used during dependency resolution. Currently, default system requirements for Linux is:
[system-requirements]
linux = "5.10"
libc = { family="glibc", version="2.28" }
If you have old versions of Linux, you need to lower the system requirements for the project, as follows:
[system-requirements]
linux = "4.12.14"
Dependency Table
This table defines the dependencies of your project.
For example, to use 2.1.4 version of pandas module, add the following to the configuration file:
[dependencies]
pandas = "2.1.4"
Environments Table
The environments
table defines your environments. You can have different environments in the same table.
The following fields can be used to define each environment:
* features defines the features that are included in the environment.
* solve-group is responsible for grouping environments during the solve stage. This is beneficial for environments that require identical dependencies but may add extra ones. Take, for example, the scenario of testing a production environment with extra test dependencies.
The following example defines two envirouments: test
and dev
:
[environments]
test = {features = ["test"], solve-group = "test"}
dev = {features = ["dev"], solve-group = "test"}
For more information about the dependencies table, see the dependencies table.