Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CondaValueError: The target prefix is the base prefix. Aborting

I have the following conda environment file environment.yml:

name: testproject channels: - defaults dependencies: - python=3.7 prefix: /opt/projects/testproject 

Before creating the environment, only the base environment exists:

(base) me@mymachine:/opt/projects/testproject$ conda env list # conda environments: # base                  *  /opt/anaconda/anaconda3 

When trying to create the environment, I get the following error:

(base) me@mymachine:/opt/projects/testproject$ conda create -f environment.yml  CondaValueError: The target prefix is the base prefix. Aborting. 

What does this error mean?

like image 656
matthiash Avatar asked Jul 03 '19 14:07

matthiash


People also ask

How can Conda environment be activated?

To activate your Conda environment, type source activate <yourenvironmentname> . Note that conda activate will not work on Discovery with this version. To install a specific package, type conda install -n <yourenvironmentname> [package] . To deactivate the current, active Conda environment, type conda deactivate .

How do you export a Conda environment?

Activate the environment to export: conda activate myenv. Replace myenv with the name of the environment. Export your active environment to a new file: conda env export > environment. yml.


1 Answers

You need to use

conda env create -f environment.yml 

Notice the extra env after conda and before create.

For more information check the documentation.

like image 198
darthbith Avatar answered Sep 23 '22 13:09

darthbith