Skip to main content

Command referenceconda env create --force

conda env create --force command (Linux & Windows / Conda)

Linux & WindowsCondapackageintermediateDestructive — use carefully

What it does

Recreate an environment from YAML even if an environment with that name already exists. When people look up conda env create force, they usually want safe flags, copyable examples, and how this Conda subcommand fits Anaconda or Miniconda workflows on Linux, Windows, and macOS. Syntax, options, and practical examples are below.

Recreate an environment from YAML even if an environment with that name already exists.

Syntax

conda env create -f FILE --force

Common options

Flag / optionMeaning
-f, --fileenvironment.yml path.
--forceRemove the existing target env before creating.
-n, --nameOverride environment name.

Practical examples

Recreate from file

conda env create -f environment.yml --force

Deletes the old env with the same name, then recreates it.

CI rebuild

conda env create -f environment.yml -n ci --force -y

Idempotent environment bootstrap for pipelines.

Common mistakes

  • Using `--force` on a shared environment name without warning teammates.
  • Forgetting to deactivate the environment before forcing recreation.

FAQ

What does conda env create --force do in Conda?

Recreate an environment from YAML even if an environment with that name already exists.

Does conda env create --force work on Windows and Linux?

Yes. Conda runs on Linux, Windows, and macOS; shell activation differs slightly after `conda init`, but the CLI flags are the same.

What is a practical conda env create --force example?

Try `conda env create -f environment.yml --force` — Deletes the old env with the same name, then recreates it.

Is mamba the same as conda env create --force?

Mamba is a faster drop-in solver for many Conda workflows. Prefer `mamba` only when it is installed; otherwise use the Conda commands on this page.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.