Command referenceconda env create
conda env create command (Linux & Windows / Conda)
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 / option | Meaning |
|---|---|
| -f, --file | Path to environment.yml (default: environment.yml). |
| -n, --name | Override the name inside the YAML. |
| -p, --prefix | Create at an explicit prefix. |
| --force | Remove 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`.
Related commands
- conda env exportExport the active (or named) environment to a YAML or explicit package lock for sharing.
- conda env updateUpdate an existing environment to match packages listed in a YAML file.
- 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.
- conda env listList all Conda environments and mark the currently active one.
- aptSearch, install, update, and remove packages on Debian-based systems.
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.