How to make new anaconda env from yml file
Question:
Answers:
conda env create
allows an option --file
for an environment file:
conda env create --name envname --file=environments.yml
conda env create --file environment.yml
The above answers did not work for me with conda 4.7.12, but this (from the Anaconda documentation) did:
conda env create -f environment.yml
Worked for me on anaconda
, mini conda
Replace the .yml file path
to location of environment.yml
file.
conda env create –prefix ./env -f ../yml file path
/environment.yml
To sum up (as of conda 4.8.4) conda env create
and conda create
are two fundamentally different commands.
conda create
- this is the official (quasi-recommended) command to create envs, listed in the general commands section of the docs
conda create --file
expects a requirements.txt
, not an environment.yml
, each line in the given file is treated as a package-reference
conda env create
- instead, this command is needed to create an environment from a given
environment.yml
- environment.yml files have a specific syntax (e.g. for env name, source channels, packages)
- e.g.
conda env create --file environment.yml
- some flags available with
conda create
are not available with conda env create
, such as --strict-channel-priority
, which may result in some confusion
conda env create
is only mentioned deep into the docs of conda (although I think it is the more common command to use)
conda env create
allows an option --file
for an environment file:
conda env create --name envname --file=environments.yml
conda env create --file environment.yml
The above answers did not work for me with conda 4.7.12, but this (from the Anaconda documentation) did:
conda env create -f environment.yml
Worked for me on anaconda
, mini conda
Replace the .yml file path
to location of environment.yml
file.
conda env create –prefix ./env -f ../
yml file path
/environment.yml
To sum up (as of conda 4.8.4) conda env create
and conda create
are two fundamentally different commands.
conda create
- this is the official (quasi-recommended) command to create envs, listed in the general commands section of the docs
conda create --file
expects arequirements.txt
, not anenvironment.yml
, each line in the given file is treated as a package-reference
conda env create
- instead, this command is needed to create an environment from a given
environment.yml
- environment.yml files have a specific syntax (e.g. for env name, source channels, packages)
- e.g.
conda env create --file environment.yml
- some flags available with
conda create
are not available withconda env create
, such as--strict-channel-priority
, which may result in some confusion conda env create
is only mentioned deep into the docs of conda (although I think it is the more common command to use)