Skip to content

Conda Unable to Create Environment #5947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FrostFlow13 opened this issue Apr 5, 2025 · 6 comments · May be fixed by #6010
Open

Conda Unable to Create Environment #5947

FrostFlow13 opened this issue Apr 5, 2025 · 6 comments · May be fixed by #6010

Comments

@FrostFlow13
Copy link

FrostFlow13 commented Apr 5, 2025

Bug report

As some backing information, I encountered this bug during the Nextflow Training 2.1.3 Part 6 (https://training.nextflow.io/2.1.3/hello_nextflow/06_hello_config/). I am intending on using either Singularity/Apptainer containers or defined Conda environments, and this bug poses a problem for the Conda possibility and for the training.

Expected behavior and actual behavior

Expected behavior: Running nextflow run hello-config.nf in "Part 6 Section 1.3. Run the workflow to verify that it can use Conda" should result in successful execution of the workflow.

Actual behavior: Running nextflow run hello-config.nf in "Part 6 Section 1.3. Run the workflow to verify that it can use Conda" results in an error, failing to create a Conda environment.

Steps to reproduce the problem

All steps as-written in Nextflow Training 2.1.3.

Program output

(base) [...]:/srv/dev/nextflow_playground/training/hello-nextflow$ nextflow run hello-config.nf

 N E X T F L O W   ~  version 24.10.5

Launching `hello-config.nf` [distracted_roentgen] DSL2 - revision: e9e72441e9

executor >  local (7)
executor >  local (7)
[ce/031a4a] sayHello (1)       | 3 of 3 ✔
executor >  local (7)
[ce/031a4a] sayHello (1)       | 3 of 3 ✔
[ec/cda30b] convertToUpper (2) | 3 of 3 ✔
[38/d09c56] collectGreetings   | 1 of 1 ✔
[-        ] cowpy              -
There were 3 greetings in this batch
Creating env using conda: conda-forge::cowpy==1.1.5 [cache /srv/dev/nextflow_playground/training/hello-nextflow/work/conda/env-898314d566668b6587ad714ae06b8520]
ERROR ~ Error executing process > 'cowpy'

Caused by:
  Failed to create Conda environment
    command: conda create --mkdir --yes --quiet --prefix /srv/dev/nextflow_playground/training/hello-nextflow/work/conda/env-898314d566668b6587ad714ae06b8520 conda-forge::cowpy==1.1.5
    status : 2
    message:
      usage: conda [-h] [-v] [--no-plugins] [-V] COMMAND ...
      conda: error: unrecognized arguments: --mkdir



 -- Check '.nextflow.log' file for details

.nextflow.log

Environment

  • Nextflow version: [24.10.5]
  • Java version: [openjdk version "17.0.10" 2024-01-16]
  • Operating system: [Ubuntu 24.04.1 LTS]
  • Bash version: [GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)]

Additional context

After doing some digging, this may be related to the version of Conda I am running (Conda 25.3.0). According to the Release Notes (https://docs.conda.io/projects/conda/en/stable/release-notes.html#deprecations),

Remove conda create --mkdir. Redundant argument. (#14644)

I believe this error is related to Nextflow attempting to still use the "--mkdir" argument. Would there be any way to create a workaround, or should I attempt to install a version of Conda prior to 25.3.0?

@FrostFlow13
Copy link
Author

Installing Conda 25.1.1 resulted in successful creation of the environment and a successful run of the code, further supporting the likelihood of an incompatibility with Conda 25.3.0.

@pditommaso
Copy link
Member

Thanks for this troubleshooting. If I'm understanding correctly they have restored it in 4.6 stating this conda/conda#7211.

In this case the better thing to do it so add a warning in the docs. /cc @christopher-hakkaart

@danpal96
Copy link

According to: https://github.com/conda/conda/blob/3259a9c914446a44b12e7c4fa191972892b8e394/CHANGELOG.md#2530-2025-03-17
conda create --mkdir was removed for being redundant in 25.3.0 (2025-03-17) conda/conda#14644

@christopher-hakkaart
Copy link
Collaborator

Thanks @danpal96 , I'll double check this and update the docs accordingly.

@FrostFlow13
Copy link
Author

FrostFlow13 commented Apr 13, 2025

I was working on a pipeline of my own, and I discovered that this issue also appears to be present for Mamba (2.1.0), where it also throws the error:

[...]
Failed to create Conda environment
command: mamba create --mkdir --yes --quiet --prefix /srv/dev/denovo_assembly_pipeline/work/conda/env-4b2cd02f7d6d162881d93d79c8e66d66 bioconda::fastp==0.24.0
status : 109
    message:
        The following argument was not expected: --mkdir

I have not yet tried older versions of Mamba, but unlike Conda I am not able to find a specific changelog note of Mamba removing --mkdir, but it could just be that I haven't dug far enough.

@christopher-hakkaart
Copy link
Collaborator

I've been testing this today and agree with @danpal96 that --mkdir was removed in 25.3.0.

It looks like it was a warning that it would be depreciated from 25.3.0 onwards. I can't see anything suggesting it would be added back.

@nathanweeks nathanweeks linked a pull request Apr 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants