Conda: Remove All Installed Packages from Base/Root Environment
Tl: Dr: How Can I Remove All Installed Packages from Base? I Installed a Bunch of Machine Learning Packages in My Base Conda Environment. I've Now Created a Ml...
TL:DR: How can I remove all installed packages from base?
I installed a bunch of machine learning packages in my base conda environment.
I've now created a ml environment for machine learning, and wish to reset my base environment by removing all the packages installed there.
I've tried:
% activate base
% conda uninstall -n base --all
CondaEnvironmentError: cannot remove current environment. deactivate and run conda remove again
Apparently, I can't remove packages from the current environment(?!), so lets switch to my ml environment first:
% source activate ml
% conda uninstall -n base --all
CondaEnvironmentError: cannot remove root environment,
add -n NAME or -p PREFIX option
Orright, I'll use -p then...
% conda uninstall -p ~/.local/share/miniconda3 --all
CondaEnvironmentError: cannot remove root environment,
add -n NAME or -p PREFIX option
How do I uninstall all installed packages in the base or root environment?
4 Answers
Apparently, I can't remove packages from the current environment(?!)
It's not that, but instead that you can't remove the base environment, which is what the --all flag does. You can't uninstall all packages in base because that's where the conda executable lives. Instead, what you want to do is uninstall all user-installed packages.