Skip to main content

Command referenceconda env create

conda env create command (Linux & Windows / Conda)

Linux & WindowsCondapackagebeginner

What it does

Create an environment from an environment.yml (or similar) specification file. When people look up conda env create yaml, 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.

Create an environment from an environment.yml (or similar) specification file.

Syntax

conda env create [-f FILE] [-n ENV | -p PATH] [options]

Common options

Flag / optionMeaning
-f, --filePath to environment.yml (default: environment.yml).
-n, --nameOverride the name inside the YAML.
-p, --prefixCreate at an explicit prefix.
--forceRemove an existing env at the target name/prefix first.

Practical examples

Default file

conda env create -f environment.yml

Builds the environment described in the project YAML.

Rename on create

conda env create -f environment.yml -n project-dev

Uses the file's packages but a different env name.

Prefix install

conda env create -f environment.yml -p ./envs/app

Creates the env beside the repository.

Recreate cleanly

conda env create -f environment.yml --force

Replaces an existing env with the same name when recreating from YAML.

Common mistakes

  • Editing YAML by hand with invalid package pins, then blaming Conda for solver errors.
  • Using `conda create` with a YAML file instead of `conda env create` / `conda env update`.

FAQ

What does conda env create do in Conda?

Create an environment from an environment.yml (or similar) specification file.

Does conda env create 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 example?

Try `conda env create -f environment.yml` — Builds the environment described in the project YAML.

Is mamba the same as conda env create?

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.