I know I can delete a single environment with
conda remove -n envname --all
but I often create multiple new environments for installing a specifiy package or testing it so I'll regularly end up with 5-10 environments and it's a pain to delete them after one another. Is there an easy way (for windows) to delete all environments except the root-environment?
Go to the start menu, right-click 'Anaconda Prompt' and go to file location. Open its properties & change the target to the location of your preferred environment.
Remove a list of packages from a specified conda environment. This command will also remove any package that depends on any of the specified packages as well---unless a replacement can be found without that dependency.
Removing all directories inside the envs
subdirectory that resides inside conda
does the job. This is generally in your user folder ~
.
~\.conda\envs\
Mac/Linux based systems could remove all environments like this.
for i in `conda env list|awk '{print $1}'|egrep -v 'base|#'|tr '\n' ' '`;do echo $i;conda env remove --name $i;done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With