Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ If you would like to contribute to conda-lock, please refer to the [Contributing

## Basic usage

Mamba 2.x and micromamba can [install unified lockfiles directly](https://conda.github.io/conda-lock/basic_usage/#installing-with-mamba-or-micromamba)
without conda-lock on the target machine; see the linked guide for filename, category, and pip requirements.

```bash
# generate a multi-platform lockfile
conda-lock -f environment.yml -p osx-64 -p linux-64
Expand All @@ -53,6 +56,9 @@ conda-lock --update pydantic
# create an environment from the lockfile
conda-lock install [-p {prefix}|-n {name}]

# alternatively, install the unified lockfile directly with mamba 2.x
mamba create -n my-locked-env -f conda-lock.yml

# alternatively, render a single-platform lockfile and use conda command directly
conda-lock render -p linux-64
conda create -n my-locked-env --file conda-linux-64.lock
Expand Down
34 changes: 34 additions & 0 deletions docs/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,40 @@ Create an environment from the lockfile
conda-lock install [-p {prefix}|-n {name}]
```

#### Installing with mamba or micromamba

Mamba 2.x and micromamba can create an environment directly from the unified
lockfile, without installing conda-lock on the target machine or running a Conda
solve:

```shell
mamba create -n my-locked-env -f conda-lock.yml
# Or use micromamba:
micromamba create -n my-locked-env -f conda-lock.yml
```

The filename must end in `-lock.yml` or `-lock.yaml`, and the lockfile must contain
the target platform. Only the `main` category is selected by default. To include
development dependencies, select both categories:

```shell
mamba create -n my-locked-env -f conda-lock.yml --category main --category dev
```

Repeat `--category` for any additional categories you need. The selected packages
include both Conda and pip entries. Pip entries are installed with pip inside
the new environment, so the lockfile must include Python and pip when it contains
pip packages.

Micromamba introduced unified-lockfile support in
[0.23.0](https://github.com/mamba-org/mamba/blob/main/CHANGELOG.md#20220421).
Mamba adopted micromamba's CLI in
[2.0](https://mamba.readthedocs.io/en/latest/developer_zone/changes-2.0.html).
Use a current release; see the upstream
[lockfile documentation](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html#conda-lock-yaml-spec-files).

#### Installing a rendered lockfile

Alternatively, render a single-platform lockfile and use conda command directly

```shell
Expand Down
14 changes: 13 additions & 1 deletion docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ To install from one of these lockfiles
conda-lock install conda-lock.yml
```

For proper parsing the unified lockfile must have the proper `.conda-lock.yml` extension (e.g foo.conda-lock.yml)
Mamba 2.x and micromamba also install unified lockfiles directly, including pip
entries. For example:

```shell
mamba create -n my-locked-env -f conda-lock.yml
```

For these tools, the filename must end in `-lock.yml` or `-lock.yaml`. They select
the current platform and the `main` category by default. See
[direct installation](basic_usage.md#installing-with-mamba-or-micromamba) for
category selection and Python/pip requirements.

Conda-lock itself detects the lockfile format from its contents.

### Render

Expand Down
Loading