Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install packages into existing conda environment specified in environment.yml

I have anaconda environment called 'juldou_learning'.

I downloaded from Git a project with environment.yml inside.

I don't want to create new environment with environment.yml like:

conda env create -f environment.yml

but, only install packages to juldou_learning which are present in environment.yml file.

following does not work:

(juldou_learning) MBPuzivlaJulius:juldou_learning juldou$ conda install --file environment.yml 

CondaValueError: could not parse 'name: juldou_learning' in: environment.yml
like image 933
Július Marko Avatar asked Aug 04 '17 15:08

Július Marko


2 Answers

You can use the env command

conda env update --file environment.yml

You may need to activate the environment into which the packages are going to be installed first.

like image 63
darthbith Avatar answered Nov 17 '22 15:11

darthbith


Like @darthbith said, use conda-env update, but don't forget to name the environment you want to install the packages into. If the environment.yml file contains an environment name, your packages will get installed there, regardless of which environment is currently activated. Here's how to name the target environment name:

conda env update --name environment_name --file environment.yml

Of course there are short argument names for --name and --file. To install the environment.yml packages in my base conda environment (the one that's activated if you haven't activated any others) I had to:

conda env update -n base -f environment.yml
like image 30
hobs Avatar answered Nov 17 '22 14:11

hobs