Skip to main content

conda-lockfiles

Support for different lockfiles in the conda CLI tool.

What is this?

conda-lockfiles adds support for additional lockfile formats to conda. It supports different types of lockfiles from the ecosystem like conda-lock or pixi.

A lockfile is a machine-generated file that records the exact versions and sources of every package in a given environment, including all dependencies, in its fully-resolved state. Unlike with environment.yml, requirements.txt, or similar files, lockfiles do not require the environment to be solved again, which might introduce differences from the original environment. Lockfiles can reproduce exact environments across different machines and points in time again and again.

The basic usage is:

# Create environment from lockfile
conda create --name ENV-NAME --format FORMAT --file /path/to/lockfile

# Export current environment to lockfile
conda export --name ENV-NAME --format FORMAT --file /path/to/lockfile

If conda recognizes your lockfile's format, the --format flag is optional with conda create.

Currently supported lockfile formats are:

  • conda-lock.yml / conda-lock.yamlconda-lock-v1 (alias: conda-lock)
  • pixi.lockrattler-lock-v6 (aliases: pixi, pixi-lock-v6)

The version-pinned names (such as -v1, -v6) never change meaning. The short aliases track the current-stable version. For information on when to use which name, see format aliases.

Installation

conda-lockfiles is a conda plugin and must be installed in the base environment:

conda install --name base conda-forge::conda-lockfiles

Usage

Creating a lockfile for the current environment

conda export --format FORMAT --file FILE

To specify additional platforms:

conda export --format FORMAT --file FILE [--override-platforms] --platform PLATFORM ...

See conda export docs for more details.

Creating a new environment from a lockfile

conda create --file FILE

If conda is unable to determine the file format:

conda create --file FILE --format FORMAT

See conda create docs for more details.

Examples

Export one conda-lock file with several platforms (adjust platforms to what you need; exporting a platform different than the host may fail):

conda export \
  --name myenv \
  --format conda-lock-v1 \
  --file conda-lock.yml \
  --platform linux-64 \
  --platform osx-64

Create an environment from that lockfile:

conda create --name myenv --file conda-lock.yml
# if the format is not auto-detected:
conda create --name myenv --file dev-lock.yml --format conda-lock-v1

Pixi / rattler lock v6:

conda export --name myenv --format pixi --file pixi.lock
conda create --name myenv --file pixi.lock --format pixi

pixi resolves to rattler-lock-v6 today. Use --format rattler-lock-v6 in committed lockfiles and CI so a future alias flip doesn't change the written format.

More information and example workflows are available on our online documentation.

Contributing

Please refer to CONTRIBUTING.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conda_lockfiles-0.2.1.tar.gz (216.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

conda_lockfiles-0.2.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file conda_lockfiles-0.2.1.tar.gz.

File metadata

  • Download URL: conda_lockfiles-0.2.1.tar.gz
  • Upload date:
  • Size: 216.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for conda_lockfiles-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3e7ae4644b2bbc93738fcdfebd28cdc520d591cba5e8d574846a0be9be8d377a
MD5 9a499a2b65f03d9ed491e0077d2b8a4c
BLAKE2b-256 a55d181232993f6c4bb202c166e62b67be31522a0da9527062d00c24d61c2c9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for conda_lockfiles-0.2.1.tar.gz:

Publisher: pypi.yml on conda/conda-lockfiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file conda_lockfiles-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for conda_lockfiles-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c79dbc18d5e6a388b27cec32b830dd24550bb859ded98c74a47296bcae1fe59
MD5 01711909d657c427c13af4d7aa2eb553
BLAKE2b-256 49647af6cd003054eed5443024f41d740e97111f8bac4167280b32faa698195b

See more details on using hashes here.

Provenance

The following attestation bundles were made for conda_lockfiles-0.2.1-py3-none-any.whl:

Publisher: pypi.yml on conda/conda-lockfiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page