The Two Ecosystems
Conda Ecosystem
Conda is a cross-platform, cross-language package ecosystem widely used in data science and scientific computing. Key characteristics:- Binary packages - No compilation needed, fast installation
- Cross-language - Python, R, C++, Julia, and more
- System dependencies - Handles compilers, libraries, tools
- Reproducible - Exact builds with hashes
- conda-forge - Community-driven, 20,000+ packages
- bioconda - Bioinformatics packages
- nvidia - CUDA and GPU packages
PyPI Ecosystem
PyPI (Python Package Index) is the main package index for Python. Key characteristics:- Source and wheels - Source distributions or pre-built wheels
- Python-only - Focused on Python packages
- Large ecosystem - 500,000+ packages, lower barrier to entry
- Variable quality - Wider range of package quality
- Source distributions (sdist) - Require compilation
- Wheels - Pre-built binary packages
Tool Comparison
Pixi’s Integration: uv by Astral
Pixi uses theuv library from Astral to handle PyPI packages.
Pixi doesn’t install
uv as a separate tool - both are built in Rust and uv is used as a library.uv, which enables fast and reliable PyPI package handling. Pixi originally built a library called rip for PyPI support, but switched to uv as it matured.
Background:
The Conda-First Approach
Pixi uses a conda-first approach to resolve dependencies:Resolution Process
- Conda resolution - Solve all conda dependencies first
- Package mapping - Map conda packages to their PyPI equivalents
- PyPI resolution - Solve remaining PyPI dependencies
- Installation - Install all packages together
Example: Overlapping Dependencies
Example: PyPI-Only Package
The Two Solvers
Pixi uses two different dependency solvers: Conda Solver:resolvo
- Implemented in
rattler - SAT solver for conda packages
- Handles complex constraint satisfaction
PubGrub
- Implemented in
uv - Modern dependency resolution algorithm
- Lazy metadata resolution for speed
The goal is to eventually have a single unified solver (
resolvo) that handles both ecosystems.Why Conda First?
PyPI packages need a base environment to install into:- Python interpreter (from conda)
- System libraries (from conda)
- Compilers (from conda, if needed)
Package Mapping
Pixi usesparselmouth to map conda packages to their PyPI equivalents.
Example mapping:
- Conda
numpy→ PyPInumpy - Conda
py-cpuinfo→ PyPIpy-cpuinfo - Conda
python→ No PyPI equivalent (it IS Python)
pixi.toml:
Common Issue: Pinned Package Conflicts
When mixing conda and PyPI dependencies, you might see:- Conda solver chose latest
typing_extensions(4.15.0) - PyPI solver tried to install 4.14
- Conflict! Both can’t be installed
Indirect Dependencies
Conflicts can also occur through transitive dependencies:Best Practices
Prefer Conda When Available
Use PyPI for Development Tools
Match Constraints Across Ecosystems
Separate by Purpose
Real-World Example
Machine learning project using both ecosystems:- Uses conda for core scientific packages (faster, binary)
- Uses PyPI for specialized ML tools (latest versions)
- Separates development tools in PyPI
- Ensures CUDA support via conda packages