I know that the following command can be used to remove one specific anaconda environment:
$ conda env remove -n env_name
But, is there any way I can specify multiple anaconda environment names in the above command line?
According to the conda documentation, it doesn't seem like conda remove supports multiple envs, but a simple for loop would do the trick.
On Windows:
FOR %G in (env1 env2 env3) DO (conda remove -n %G --all --yes)
Note that if this is done from within a batch script, you might have to use %%G instead of %G
On Linux:
for env_name in env1 env2 env3; do conda remove -n $env_name --all --yes; done
Also note that the --yes option will remove the confirmation promt from conda remove, so be careful not to accidentally remove the wrong envs.
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