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

15,436

Solution 1

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

Solution 2

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

Solution 3

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.

Share:
15,436

Related videos on Youtube

Randall Blake
Author by

Randall Blake

Updated on June 07, 2022

Comments

  • Randall Blake
    Randall Blake almost 2 years

    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
    
    • cel
      cel about 8 years
      For troubles shooting I would first update conda to the latest version. If this does not help, I would do source activate data-env and see if conda install seaborn works.
    • Randall Blake
      Randall Blake about 8 years
      Thanks, but I tried that. Same error. :-( I'm afraid I may have to uninstall all versions of python (except system version (I'm on a Mac)), and reinstall. But I don't understand why that should be necessary.
    • cel
      cel about 8 years
      Can you add conda --version and conda env list?
    • Randall Blake
      Randall Blake about 8 years
      Edited original post to add conda version and env list.
    • mwaskom
      mwaskom about 8 years
      Is there some reason you think the problem is specific to seaborn? Have you tried installing other packages?
    • Randall Blake
      Randall Blake about 8 years
      I successfully installed a few other packages. This is the first one I have had trouble with. And, as I noted above, I first successfully installed seaborn but it got installed in the root environment. When I was unable to access seaborn in my iPython notebook, I tried installing seaborn in the correct environment and that is when the problem started.
    • mwaskom
      mwaskom about 8 years
      That doesn't answer the question of whether, if you try to install other packages into the environment currently, you get the same problem.
    • Edison Gustavo Muenz
      Edison Gustavo Muenz about 8 years
      I couldn't reproduce your problem. I did: "conda create -n dato-env python=3 && conda install --name dato-env seaborn" and everything installed correctly. I've tried with conda 4.0.2 and 4.0.5. I'm on linux though.
    • Randall Blake
      Randall Blake about 8 years
      I can't find any useful information on this error on the web. I nuked my python/anaconda installation and reinstalled. seaborn package is working now.
  • Randall Blake
    Randall Blake about 8 years
    That was the problem. Thanks. (It happened to me again. The first time I nuked everything and started over. The second time I simply removed the conda packages from the non-root environment. That worked.)
  • James
    James almost 8 years
    if you are building from a *.yml file you can also go into the file and delete those items under dependencies.
  • user3731622
    user3731622 about 7 years
    I encountered this problem after trying to install matplotlib-venn in a cloned root environment using conda install -c conda-forge matplotlib-venn=0.11.4 . The posted solution fixed allowed me to install matplotlib-venn. This seems like a problem Anaconda should fix.
  • holdenweb
    holdenweb over 5 years
    Recent updates to conda have renamed root to base, and the --clone option now excludes the conda components.