Backwards compatibility with conda

Last updated on 2026-10-27 | Edit this page

Overview

Questions

  • Can Pixi environments be backported to conda formats?

Objectives

  • Learn how to export Pixi workspace environments as conda environment definition files
  • Learn how to export Pixi workspace environments as conda explicit spec files

Backporting to conda environments


While Pixi is currently unique in its abilities, there may be situations in which given technical debt, migration effort in large collaborations, or collaborator preferences, switching all infrastructure to use Pixi might not yet be feasible. It would still be useful to take advantage of Pixi’s technology and features as an individual but be able to export Pixi workspace environments and lock files to the “legacy system” of conda. 1 Luckily, we can do this with the pixi workspace export commands.

Exporting workspace environments to conda environment definition files


If you want to export a Pixi workspace environment’s high level dependencies to a conda environment definition file (environment.yaml) you can use the pixi workspace export conda-environment subcommand

BASH

pixi workspace export conda-environment --environment <environment> --platform <platform> environment.yaml

where if no environment or platform options are given the default environment and the system’s platform will be used.

Challenge

Export one of your Pixi workspace environments to a conda environment

BASH

pixi workspace export conda-environment environment.yaml

YAML

name: default
channels:
- conda-forge
- nodefaults
dependencies:
- python >=3.15.2,<3.16
- numpy >=2.5.4,<3
- notebook >=7.6.3,<8
- jupyterlab >=4.6.4,<5

Exporting workspace environments to conda explicit spec files


We’d like to ideally go further than the high level conda environment definition file and aim for computational reproducibility with a conda explicit spec file. Conda explicit spec files are a form of platform specific lock files that consist of a text file with an @EXPLICIT header followed by a list of conda package URLs, optionally followed by their MD5 or SHA256 digest (aka, “hash”).

Example:

TXT

@EXPLICIT
https://conda.anaconda.org/conda-forge/noarch/python_abi-3.13-7_cp313.conda#e84b44e6300f1703cb25d29120c5b1d8

Explicit spec files can be created from locked Pixi workspace environments with the pixi workspace export conda-explicit-spec subcommand

BASH

pixi workspace export conda-explicit-spec --environment <environment> --platform <platform> .

where if no environment or platform options are given the default environment and the system’s platform will be used. The explicit spec file will be automatically named with the form <environment>_<platform>_conda_spec.txt. So if you are on a linux-64 machine and didn’t specify an environment name, your generated explicit spec file will be named default_linux-64_conda_spec.txt.

Caution

Conda spec files only support conda packages and do not support Python packages or source packages.

Challenge

Export one of your Pixi workspace environment lock files as a conda explicit spec file

Hint: Check the --help output.

BASH

pixi workspace export conda-explicit-spec --platform linux-64 --platform osx-arm64 .

BASH

head -n 20 default_linux-64_conda_spec.txt

OUTPUT

# Generated by `pixi workspace export`
# platform: linux-64
@EXPLICIT
https://conda.anaconda.org/conda-forge/noarch/python_abi-3.15-9_cp315.conda#b23461631fe2abdbade0cb64babe7344
https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda#0de0122d9570a8ab637c6b73db268389
https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda#aa459086047c0e5e27023ab19f8cb86a
https://conda.anaconda.org/conda-forge/noarch/tzdata-2026e-h5d301ff_0.conda#abccc3810d2b97e570dee487f2b46e38
https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.2.0-he0feb66_7.conda#d904c7ddd95e026254b4b80808ee9e12
https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda#a9f577daf3de00bca7c3c76c0ecbd1de
https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.2.0-ha9f2e26_7.conda#735629b400b70eeab21a2ba8f5b1c2ce
https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h1df4ec4_4.conda#676a2f9b1c4fcf57b70aa5c65f6c60d0
https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.10.23-hbd8a1cb_0.conda#3fd02989038a1e1cee627c14c2d73f29
https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.5-h781a0a9_0.conda#5a51a2ea653f120240b1a9bf76e0aae9
https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda#ee6c0cd80a60961a1f48aa3e0b91f986
https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.4-hcfc3c73_0.conda#54a948337e66706380ff24d6b5fde63f
https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.54.1-h0737f62_101.conda#36e097bf5f1e0699e88c8ac801f2dc65
https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_2.conda#fcfed1dc5053eb1901b66e7b1fc32588
https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda#1390b7c5ac0b1d8e447bc5efa6d3c8c2
https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h81df57d_1.conda#6525a0b06aa4fd390795f0740636a9dd
https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.9.0-hd2095e1_0.conda#317ecabe4a58b3068c7958dc5eb89e43

BASH

head -n 20 default_osx-arm64_conda_spec.txt

OUTPUT

# Generated by `pixi workspace export`
# platform: osx-arm64
@EXPLICIT
https://conda.anaconda.org/conda-forge/noarch/python_abi-3.15-9_cp315.conda#b23461631fe2abdbade0cb64babe7344
https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.2-h8088a28_3.conda#f39288f0ea63ae962e1a2e4f355a0d75
https://conda.anaconda.org/conda-forge/osx-arm64/zstd-1.5.7-hf451053_7.conda#4ec2684c73812cc2c3d78379384a39cc
https://conda.anaconda.org/conda-forge/noarch/tzdata-2026e-h5d301ff_0.conda#abccc3810d2b97e570dee487f2b46e38
https://conda.anaconda.org/conda-forge/osx-arm64/tk-8.6.13-hbeba79b_4.conda#90a01bf394d1c594e0eb9258f967d828
https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.10.23-hbd8a1cb_0.conda#3fd02989038a1e1cee627c14c2d73f29
https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.6.5-h55eecbc_0.conda#45d9179cdf6e53d88aec034246f0dad6
https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.6-he64c551_1.conda#3dfa0d0316dc246cd44937a557de4501
https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.54.1-h34a968b_101.conda#6b3b2ea51e2685192a790730c59dbb01
https://conda.anaconda.org/conda-forge/osx-arm64/libmpdec-4.0.0-h84a0fba_2.conda#ff33a4dbd93abc8a798cc4e0e7c8136d
https://conda.anaconda.org/conda-forge/osx-arm64/liblzma-5.8.3-h8088a28_1.conda#8ab10323068b107661a4b9a4af84f3b5
https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.7.0-h47dc5ef_1.conda#216bbcc23c11e9695b3db4a8771d76eb
https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.9.0-h6111c0a_0.conda#f85a1fda9a2758a7aef2a7787d9c0203
https://conda.anaconda.org/conda-forge/osx-arm64/libedit-3.1.20260512-pl5321h26f1114_0.conda#ef2ab2462744ec6ba3a54c34dcc6a06e
https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h4e30115_10.conda#b50612e7d190b8061ab4e7dc119cf4d5
https://conda.anaconda.org/conda-forge/osx-arm64/python-3.15.2-h2e4dbab_100_cp315.conda#b4665b09f097706f547ef7048afee0be
https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-23.1.4-hdb3d66b_0.conda#9a6ec2a53da5d75951b88c51018c27fa
Caution

While conda spec files meet our criteria for computational reproducibility, they are essentially package list snapshots and lack the metadata to provide robust dependency graph inspection and targeted updates. They can be a useful tool, but are not robust lock file formats like those from Pixi and conda-lock.

Creating conda environments from the exports


To create a conda environment from the exported environment.yaml conda environment definition file, you use the normal conda environment creation command

BASH

conda env create --file environment.yaml

but to create a conda environment from the exported conda explicit spec file, use the command

BASH

conda create --name <name> --file <spec file>

or to install the packages given in the explicit spec file into an existing conda environment, use

BASH

conda install --name <name> --file <spec file>

So by using Pixi, you can fully export your workspace environments to conda environments and then use them, even to get the exact hash level locked environment from your Pixi workspace installed on another machine!

Caution

Conda does not check that the platform is correct for the machine or the dependencies given when installing from an explicit spec file. Only use spec files when you are certain that you have the same platform machine as the machine that created the spec file.

Key Points
  • If you need to use conda, you can export Pixi workspace environments to formats conda can use.
  • Exporting conda explicit spec files from Pixi locked environments provides the ability to create the same hash level locked environment with conda that Pixi solved.

  1. Conda is still a very well supported tool and the dominant conda package environment manager by numbers of users.↩︎