Skip to content

Commit

Permalink
Update user guide to reflect conda-libmamba-solver being default (#517)
Browse files Browse the repository at this point in the history
* Update user guide documentation

* add news

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jaimergp and pre-commit-ci[bot] authored Aug 29, 2024
1 parent 0cda13e commit ceae580
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
2 changes: 2 additions & 0 deletions docs/user-guide/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ We recommend you upgrade to `conda` 22.11 or above, and then `conda-libmamba-sol
See the [22.12.0 announcement post](https://github.com/conda/conda-libmamba-solver/releases/tag/22.12.0) for more details on how to upgrade.
(install-older-conda)=
## I have an older `conda` and I can't install `conda-libmamba-solver`
Since older `conda` versions only supported the `classic` solver, you might run into solver conflicts or too long installations if your `base` environment is too constrained. This becomes a "chicken-and-egg" problem where you'd need `conda-libmamba-solver` to update to a more recent `conda` with `conda-libmamba-solver`.
Expand Down
47 changes: 31 additions & 16 deletions docs/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,69 @@ The `conda-libmamba-solver` plugin allows you to use `libmamba`, the same `libso

## How to install

`conda-libmamba-solver` is distributed as a separate package, available on both conda-forge and defaults. The plugin needs to be present in the same environment you use `conda` from; most of the time, this is your `base` environment. Run this command:
If you have a recent `conda` (23.10 or later), you don't have to do anything. `conda-libmamba-solver` is already preconfigured as default.
For older versions `conda`, we simply recommend updating `conda` to a more recent version:

```bash
$ conda install -n base conda-libmamba-solver
```console
$ conda update -n base conda
```

### Update from the experimental versions (22.9 and below)
If this command fails, check this entry in the FAQ section: {ref}`install-older-conda`.

The instructions in this page assume you are using conda-libmamba-solver 22.12 or above.
Please refer to the [v22.12.0 release notes](https://github.com/conda/conda-libmamba-solver/releases/tag/22.12.0) for more details on how to update from a previous version if you were already using the experimental builds.
```{admonition} Update from the experimental versions
:class: note
Please refer to the [v22.12.0 release notes](https://github.com/conda/conda-libmamba-solver/releases/tag/22.12.0) for more details on how to update from a previous version if you were already using the experimental builds (conda-libmamba-solver 22.9 and below).
```

## Usage

Even if installed, `conda` won't use `conda-libmamba-solver` by default. It will still rely on the `classic` solver.
From `conda` 23.10, `conda-libmamba-solver` is the default solver. You don't have to do anything else. It will just work.


````{admonition} Usage with conda 23.9 and below
`conda <23.10` won't use `conda-libmamba-solver` by default.
It will still rely on the `classic` solver.
<details>
### Try it once
<summary>Sporadic use</summary>
To enable it for one operation, you can use the `--solver` flag, available for `conda create|install|remove|update` commands.
```
$ conda install tensorflow --solver=libmamba
```
```{note}
The `--solver` flag is also exposed as an environment variable, `CONDA_SOLVER`,
Note: The `--solver` flag is also exposed as an environment variable, `CONDA_SOLVER`,
in case you need that.
```
### Set as default
</details>
<details>
<summary>Set as default</summary>
To enable it permanently, you can add `solver: libmamba` to your `.condarc` file, either manually, or with this command:
```
$ conda config --set solver libmamba
```
### Revert to `classic`
</details>
````

## Revert to `classic`

If you ever need to use the classic solver temporarily, you can again rely on the `--solver` flag:
If you ever need to use the classic solver temporarily, use `--solver` flag:

```
$ conda install numpy --solver=classic
```

Finally, if you need to revert the default configuration back to `classic`, you can:

* Run `conda config --set solver classic` (to do your choice explicit).
* Run `conda config --remove-key solver` to delete the `solver: libmamba` line from your `.condarc` file.
* Run `conda config --set solver classic` (to make your choice explicit).

```{admonition} Tip
If you are unsure what configuration is being used by conda, you can inspect
Expand Down
19 changes: 19 additions & 0 deletions news/517-docs-conda-libmamba-solver-default
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* Update user guide to reflect conda-libmamba-solver being the default solver in conda. (#516 via #517)

### Other

* <news item>

0 comments on commit ceae580

Please sign in to comment.