Error: 'conda' can only be installed into the root environment
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.
Related videos on Youtube
Randall Blake
Updated on June 07, 2022Comments
-
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 about 8 yearsFor 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 ifconda install seaborn
works. -
Randall Blake about 8 yearsThanks, 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 about 8 yearsCan you add
conda --version
andconda env list
? -
Randall Blake about 8 yearsEdited original post to add conda version and env list.
-
mwaskom about 8 yearsIs there some reason you think the problem is specific to seaborn? Have you tried installing other packages?
-
Randall Blake about 8 yearsI 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 about 8 yearsThat 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 about 8 yearsI 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 about 8 yearsI 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 about 8 yearsThat 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 almost 8 yearsif you are building from a *.yml file you can also go into the file and delete those items under dependencies.
-
user3731622 about 7 yearsI encountered this problem after trying to install
matplotlib-venn
in a cloned root environment usingconda install -c conda-forge matplotlib-venn=0.11.4
. The posted solution fixed allowed me to installmatplotlib-venn
. This seems like a problem Anaconda should fix. -
holdenweb over 5 yearsRecent updates to conda have renamed
root
tobase
, and the--clone
option now excludes the conda components.