Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: 'conda' can only be installed into the root environment

I am getting the following error when I try to install the python package seaborn:

conda install --name dato-env seaborn
Error: 'conda' can only be installed into the root environment

This, of course, is puzzling because I am not trying to install conda. I am trying to install seaborn.

This is my setup. I have 3 python environments:

  • dato-env
  • py35
  • root

I successfully installed seaborn previously (with the command conda install seaborn), but it installed in the root environment (and is not available to my iPython notebooks which are using the dato-env).

I tried to install seaborn in the dato-env environment so that it would be available to my iPython notebook code, but I keep getting the above error saying that I must install conda in the root environment. (conda is installed in the root environment)

How do I successfully install seaborn into my dato-env?

Thanks in advance for any assistance.

Edit:

> conda --version
conda 4.0.5
> conda env list
dato-env              *  /Users/*******/anaconda/envs/dato-env
py35                     /Users/*******/anaconda/envs/py35
root                     /Users/*******/anaconda
like image 880
Randall Blake Avatar asked Mar 20 '16 18:03

Randall Blake


People also ask

How do I enable conda environment in terminal?

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 .

Can you pip install conda?

You can install pip in the current conda environment with the command conda install pip , as discussed in Using pip in an environment. If there are instances of pip installed both inside and outside the current conda environment, the instance of pip installed inside the current conda environment is used.


3 Answers

If you clone root you get conda-build and conda-env in your new environment but afaik they shouldn't be there and are not required outside root provided root remains on your path. So if you remove them from your non-root env first your command should work. For example, I had the same error when trying to update anaconda but did not get the error doing it this way:

source activate my-env
conda remove conda-build
conda remove conda-env
conda update anaconda

See this thread for alternative and background: https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/PkXOIqlEPCU

like image 130
nodesr Avatar answered Sep 22 '22 07:09

nodesr


Copy root environment to env1.

conda create --name env1 --clone root

Activate your environment.

source activate env1

Remove some conda packages which have to be in root environment.

conda remove conda
conda remove conda-build
conda remove conda-env

Then, You can anything like this.

conda update --all
like image 41
Myeongsik Joo Avatar answered Sep 20 '22 07:09

Myeongsik Joo


I was able to replicate the problem for a number of different packages. The error only occurs when I tried to install packages in envs created using the conda create --clone option and not those created from scratch.

like image 44
Arden Burrell Avatar answered Sep 23 '22 07:09

Arden Burrell