Conda: Conda bug: CondaValueError: prefix already exists: /home/user/anaconda2

Created on 2 Mar 2018  路  3Comments  路  Source: conda/conda

I'm submitting a...

  • [X ] bug report
  • [ ] feature request

Current Behavior

I have been given an environment.yml file that I want to use. I install anaconda2 using:

bash ~/Downloads/Anaconda2-5.1.0-Linux-x86_64.sh

Now, following the documentation, I want to create my environment, so I run:

conda env create -f environment.yml

which throws the following error:

CondaValueError: prefix already exists: /home/user/anaconda2

How is it an error that anaconda is already installed? Any help here would be greatly appreciated.

Thanks

Steps to Reproduce

bash ~/Downloads/Anaconda2-5.1.0-Linux-x86_64.sh`
conda env create -f environment.yml

Expected Behavior

I think this should create the environment specified by the environment.yml file.

Environment Information

conda info


active environment : None
user config file : /home/user/.condarc
populated config files :
conda version : 4.4.11
conda-build version : 3.4.1
python version : 2.7.14.final.0
base environment : /home/user/anaconda2 (writable)
channel URLs : https://repo.continuum.io/pkgs/main/linux-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/linux-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/linux-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/linux-64
https://repo.continuum.io/pkgs/pro/noarch
package cache : /home/user/anaconda2/pkgs
/home/user/.conda/pkgs
envs directories : /home/user/anaconda2/envs
/home/user/.conda/envs
platform : linux-64
user-agent : conda/4.4.11 requests/2.18.4 CPython/2.7.14 Linux/3.16.0-4-amd64 debian/8 glibc/2.19
UID:GID : 1005:1005
netrc file : None
offline mode : False

source-community type-support

Most helpful comment

Got the same error in my anaconda3 installation. I realized my .yml file did have an empty name field. As said in the docs this is needed to execute this command.

For future reference you could do conda env create -f environment.yml -n environmentName. Or simply write the name in the yml file. Maybe a more clear error message will be helpful although I am not sure how common it is to forget naming the environment when creating a .yml file.

conda version : 4.6.3
conda-build version : 3.0.27
python version : 3.6.6.final.0
base environment : /home/user/anaconda3  (writable)

All 3 comments

I realized I'm installing the environment in the wrong place. Still seems like this is a bug, but not one that affects me.

Got the same error in my anaconda3 installation. I realized my .yml file did have an empty name field. As said in the docs this is needed to execute this command.

For future reference you could do conda env create -f environment.yml -n environmentName. Or simply write the name in the yml file. Maybe a more clear error message will be helpful although I am not sure how common it is to forget naming the environment when creating a .yml file.

conda version : 4.6.3
conda-build version : 3.0.27
python version : 3.6.6.final.0
base environment : /home/user/anaconda3  (writable)

Please open your environment.yml file and check the name of the environment, it should be the first line in your file (!). Make sure the name doesn't say
name: base
or has a similar name to existing environment you previously created which you can check by running the command conda info --envs
Change that 'name' to your new environment
name: your-new-env-name

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ItsAnkit picture ItsAnkit  路  3Comments

mathoha picture mathoha  路  3Comments

ajaypanekkad picture ajaypanekkad  路  3Comments

mhlr picture mhlr  路  3Comments

jjhelmus picture jjhelmus  路  3Comments