Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

I am working on a online course and the instructors have asked me to create a Conda environment, and they have provided a YAML file to provide the library and package requirements for the Conda package.

However, I am unable to find a way to create the environment using the YAML file.

like image 428
Shubham Pandey Avatar asked Jun 25 '17 00:06

Shubham Pandey


2 Answers

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.

like image 104
Mike Müller Avatar answered Oct 12 '22 22:10

Mike Müller


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.)

like image 31
ws_e_c421 Avatar answered Oct 12 '22 23:10

ws_e_c421