How to create a Conda environment based on a YAML file?

Use:

conda env create --name NAME --file FILE

where FILE is the YAML file and NAME is what you want to name the environment.

(The accepted answer used to suggest conda create, but that only works on the output of conda list --explicit, not on Conda environment YAML files.)


conda env create --file=dand-env-win.yaml

worked well for me where my file name was dand-env-win.yaml for a course on the Internet.


conda env create takes an optional flag --file:

-f FILE, --file FILE environment definition file (default: environment.yml)

So do:

conda env create --file=myfile.yaml

Of course, replace =myfile.yaml with your YAML file name.

Tags:

Python

Yaml

Conda