# Is it possible to use Nextflow with the \`libmamba\` conda solver?

**URL:** <https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181>\
**Category:** Ask for help\
**Created:** [October 20, 2023, 9:40am UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181 "2023-10-20T09:40:55Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfy133](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/jfy133/32/60_2.png) [@jfy133](https://community.seqera.io/u/jfy133)\
**Post date:** [October 20, 2023, 9:40am UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/1 "2023-10-20T09:40:55Z")

</div>

Hi all,

I have set up my conda installation to use the [libmamba](https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community) solver (rather than the standalone mamba binaries etc).

However when I try to use conda (v23.3.1) with a Nextflow (v23.04.1) pipeline this configured, get the following error:

```auto
    CondaValueError: You have chosen a non-default solver backend (libmamba) but it was not recognized. Choose one of: classic

```

To reproduce:

1. Set libmamba solver

```bash
conda install -n base conda-libmamba-solver
conda config --set solver libmamba

```

1. Then run a nextflow pipeline with the conda profile specified

```bash
nextflow run nf-core/taxprofiler -profile conda,test -r 1.1.1 --outdir ./results

```

Does anyone have the same problem, and if so if they have a solution?

Cheers,  
James

---

<div class="post-metadata">

**Author:** ![rpetit3](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/rpetit3/32/181_2.png) [@rpetit3](https://community.seqera.io/u/rpetit3)\
**Post date:** [October 20, 2023, 4:35pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/2 "2023-10-20T16:35:33Z")

</div>

Yo @jfy133 !

Can you dig up the conda command used by Nextflow in the `.command.run` file? Let’s see if we get the same error when running it outside of Nextflow.

Cheers,  
Robert

---

<div class="post-metadata">

**Author:** ![jfy133](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/jfy133/32/60_2.png) [@jfy133](https://community.seqera.io/u/jfy133)\
**Post date:** [October 21, 2023, 5:05am UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/3 "2023-10-21T05:05:31Z")

</div>

So the full NXF error is:

```auto
ERROR ~ Error executing process > 'NFCORE_TAXPROFILER:TAXPROFILER:LONGREAD_HOSTREMOVAL:MINIMAP2_INDEX'

Caused by:
  Failed to create Conda environment
  command: conda create --mkdir --yes --quiet --prefix /home/james/cache/conda/env-f398718d50f0fbf68c336c2cb6f533f8 bioconda::minimap2=2.24
  status : 1
  message:
    CondaValueError: You have chosen a non-default solver backend (libmamba) but it was not recognized. Choose one of: classic

```

Running the same command results in successfully creation

```bash
$ conda create --mkdir --yes --quiet --prefix /home/james/cache/conda/env-f398718d50f0fbf68c336c2cb6f533f8 bioconda::minimap2=2.24
Channels:
 - conda-forge
 - bioconda
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: /home/james/cache/conda/env-f398718d50f0fbf68c336c2cb6f533f8

  added / updated specs:
    - bioconda::minimap2=2.24

The following NEW packages will be INSTALLED:

  _libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge 
  _openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-2_gnu 
  k8 bioconda/linux-64::k8-0.2.5-hdcf5f25_4 
  libgcc-ng conda-forge/linux-64::libgcc-ng-13.2.0-h807b86a_2 
  libgomp conda-forge/linux-64::libgomp-13.2.0-h807b86a_2 
  libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-13.2.0-h7e041cc_2 
  libzlib conda-forge/linux-64::libzlib-1.2.13-hd590300_5 
  minimap2 bioconda/linux-64::minimap2-2.24-h7132678_1 
  zlib conda-forge/linux-64::zlib-1.2.13-hd590300_5 

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done

```

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [October 22, 2023, 2:24pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/4 "2023-10-22T14:24:45Z")

</div>

Hey, James!

Yes, you can. I can’t reproduce your error.

I did the following:

```auto
conda update -n base conda
conda install -n base conda-libmamba-solver
conda config --set solver libmamba

```

I confirmed with `conda config --get solver`, which returned `--set solver libmamba`. `conda config --show` also confirmed it, but much more verbose 😆

Then, I created a new folder and added the following Nextflow script:

```groovy
process FOO {
  conda 'fastqc'
  debug true

  output:
  stdout

  script:
  """
  fastqc --version
  """
}

workflow {
  FOO()
}

```

Ran with `NXF_VER=23.04.1 nextflow run main.nf -with-conda` and got as output the following:

```auto
CAPSULE: Downloading dependency io.nextflow:nextflow:jar:23.04.1
CAPSULE: Downloading dependency io.nextflow:nf-httpfs:jar:23.04.1
CAPSULE: Downloading dependency io.nextflow:nf-commons:jar:23.04.1
Nextflow 23.10.0 is available - Please consider updating your version to it
dN E X T F L O W ~ version 23.04.1
Launching `main.nf` [loving_cray] DSL2 - revision: e432c2850d
executor > local (1)
[d2/28d2f3] process > FOO [100%] 1 of 1 ✔
Creating env using conda: fastqc [cache /Users/mribeirodantas/conda-test/work/conda/env-23037893fdd4cef8d4acc5fe82ba1899]
FastQC v0.12.1

```

PS: I tried running `nextflow run nf-core/taxprofiler -profile conda,test -r 1.1.1 --outdir ./results` as you did, and it works past the `NFCORE_TAXPROFILER:TAXPROFILER:LONGREAD_HOSTREMOVAL:MINIMAP2_INDEX'` step so for some reason I can’t reproduce this either.

```auto
[bf/e48529] process > NFCORE_TAXPROFILER:TAXPROFILER:LONGREAD_HOSTREMOVAL:MINIMAP2_INDEX [100%] 1 of 1 ✔

```

I didn’t wait for it to finish, though.

**I would guess this issue is related to your conda version. I’m using v23.9.**

---

<div class="post-metadata">

**Author:** ![jfy133](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/jfy133/32/60_2.png) [@jfy133](https://community.seqera.io/u/jfy133)\
**Post date:** [October 22, 2023, 5:11pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/5 "2023-10-22T17:11:17Z")

</div>

Interesting! 🤔 Would you mind sharing the whole conda config? To see what I may have different…

And also try maybe with an nf-core pipeline? The only thing I can now think is there some conda conflict when it tries to make multiple envs at once…

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [October 22, 2023, 7:12pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/6 "2023-10-22T19:12:40Z")

</div>

> Would you mind sharing the whole conda config?

I provided no extra configuration. Empty `nextflow.config`. Added `-with-conda` to the command line, and that’s it.

> And also try maybe with an nf-core pipeline?

I did. It’s at the bottom of the previous reply.

---

<div class="post-metadata">

**Author:** ![jfy133](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/jfy133/32/60_2.png) [@jfy133](https://community.seqera.io/u/jfy133)\
**Post date:** [October 23, 2023, 4:04am UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/7 "2023-10-23T04:04:57Z")

</div>

Sorry, I meant the config of conda itself (basically what is stored in `~/.condarc`, not the nextflow conda config!

I had the same error on both old and latest version 😕

Oops sorry about the last bit - the discourse website wouldn’t load on Firefox for mobile for me so I read your response/replied via email but I guess that bit wasn’t displayed… (Now on Chrome for mobile 😬)

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [October 23, 2023, 12:51pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/8 "2023-10-23T12:51:51Z")

</div>

> [@jfy133](#):
>
> Sorry, I meant the config of conda itself (basically what is stored in `~/.condarc`, not the nextflow conda config!

Oh, sorry. You’ll find my `$HOME/.condarc` below:

```auto
auto_activate_base: false
channels:
  - conda-forge
  - bioconda
  - defaults
channel_priority: strict
changeps1: true
subdir: osx-64
report_errors: true
solver: libmamba

```

---

<div class="post-metadata">

**Author:** ![jfy133](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/jfy133/32/60_2.png) [@jfy133](https://community.seqera.io/u/jfy133)\
**Post date:** [October 24, 2023, 1:31pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/9 "2023-10-24T13:31:58Z")

</div>

> [@mribeirodantas](#):
>
> ```auto
> auto_activate_base: false
> channels:
> - conda-forge
> - bioconda
> - defaults
> channel_priority: strict
> changeps1: true
> subdir: osx-64
> report_errors: true
> solver: libmamba
> 
> ```

Nope still not working, even when I copy your config (removing the subdir section). I’m also using 23.09 conda… ☹

I’m suspecting it’s a linux thing now… @rpetit3 what OS do you typically use?

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [October 24, 2023, 1:54pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/10 "2023-10-24T13:54:58Z")

</div>

I tried it now on the [training Gitpod instance](https://gitpod.io/#https://github.com/nextflow-io/training), which runs Linux, following my steps above, and it also worked correctly 😥

```auto
nf-training -> conda --version
conda 23.9.0
nf-training -> conda config --get solver
--set solver libmamba

```

```auto
nf-training -> rm -rf work; rm -rf nextflow.config; nextflow run main.nf -with-conda
N E X T F L O W ~ version 23.10.0
Launching `main.nf` [agitated_volta] DSL2 - revision: e432c2850d
executor > local (1)
[d7/d48364] process > FOO [100%] 1 of 1 ✔
Creating env using conda: fastqc [cache /workspace/gitpod/nf-training/work/conda/env-23037893fdd4cef8d4acc5fe82ba1899]
FastQC v0.12.1

```

---

<div class="post-metadata">

**Author:** ![jfy133](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/jfy133/32/60_2.png) [@jfy133](https://community.seqera.io/u/jfy133)\
**Post date:** [October 25, 2023, 12:13pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/11 "2023-10-25T12:13:10Z")

</div>

Bizarre… must be something to do with my specific set up then… no clue what. Oh well! I’ll just have to live with it.

Thank you for the help investigating @mribeirodantas! 🙏

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [October 25, 2023, 3:22pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/12 "2023-10-25T15:22:55Z")

</div>

You’re welcome!

Let us know in the future if you manage to identify what the issue was 😅

---

<div class="post-metadata">

**Author:** ![Danielle\_Callan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/danielle_callan/32/695_2.png) [@Danielle\_Callan](https://community.seqera.io/u/Danielle_Callan)\
**Post date:** [May 7, 2024, 4:18pm UTC](https://community.seqera.io/t/is-it-possible-to-use-nextflow-with-the-libmamba-conda-solver/181/13 "2024-05-07T16:18:20Z")

</div>

i know this is a bit stale now, but i encountered this recently and found this thread… in my case at least, it _seems_ to have been that the version of libstdc++ available to my os was older than libmamba wanted.
