Python Pixi - Python Package Manager

I’ve tried several Python package managers (pip, conda, Poetry). While trying Pixi, I found its features particularly useful for production setups.

In pyproject.toml you can define dependency groups for different environments (dev, test, prod). When installing, specify the environment so only the required dependencies are installed.

This helps keep production environments clean by excluding unnecessary packages.

You can also define reusable tasks and run them with pixi run <task-name>. This is a convenient way to run common commands defined in pyproject.toml.

Installing Pixi

1
2
3
brew install pixi # macOS
# or
curl -fsSL https://pixi.sh/install.sh | sh

How to use Pixi for running a task

pyproject.toml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[project]
name = ""
version = "0.1.0"
description = ""
requires-python = "==3.12"
authors = [{ name = "<author>", email = "<email-address>" }]

[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]

[tool.pixi.dependencies]
python = "3.12.*"

[tool.pixi.pypi-dependencies]
openai = "*"
openai-agents = "*"
fastmcp = "*"
pytest = "*"
ruff = "*"
pyright = "*"
mypy = "==1.18.2"

[tool.pixi.tasks]

Quick add commands:

1
2
pixi task add format "black src/"
pixi task add lint "ruff src/ --fix"

Notes:

  • Run a single task: pixi run <task-name>
  • Make tasks depend on each other if needed (e.g., run format before lint)

Python Pixi - Python Package Manager

https://sineeli.github.io/2025/11/08/python-pixi/

Author

Siva Sravana Kumar Neeli

Posted on

2025-11-08

Updated on

2026-01-08

Licensed under