Command referenceconda env create --force
conda env create --force command (Linux & Windows / Conda)
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 / option | Meaning |
|---|---|
| -f, --file | environment.yml path. |
| --force | Remove the existing target env before creating. |
| -n, --name | Override 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.
Related commands
- conda env createCreate an environment from an environment.yml (or similar) specification file.
- conda env removeDelete a Conda environment and all packages installed inside it.
- conda env updateUpdate an existing environment to match packages listed in a YAML file.
- conda env exportExport the active (or named) environment to a YAML or explicit package lock for sharing.
- conda createCreate a new isolated Conda environment with an optional Python version and starter packages.
- conda activateActivate a named or path-based Conda environment in the current shell session.
- conda installInstall packages into the active or named Conda environment from configured channels.
- conda listList packages installed in the active or named Conda environment.
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.