I would like to delete an Anaconda environment. From this reference, it looks like I could use
conda remove --name myenv --all
or
conda env remove --name myenv
The documentation (for 4.6.0) mentions both, but does not explain the difference.
How might I determine what the --all flag does?
There is no difference in effect.
Conda has two remove commands:
conda remove - for removing packagesconda env remove - for removing environmentsBoth have a --name,-n argument that specifies the environment on which to operate. Only the former also has an --all flag, which effectively does the same thing as the latter.1
Obsolete (From Original Answer)
The original first example in the question had a typo and was invalid because it indicated to remove package(s) from an environment, but did not specify any packages. Running it would have yielded an error message:
$ conda remove -n myenv
CondaValueError: no package names supplied,
try "conda remove -h" for more details
[1] This is a slightly inconsistent API design, in my opinion. Since one can create an empty environment, I believe a more symmetric result of conda remove --all would be that it remove all the packages but still retain the empty environment. Users that want to operate on a whole environment level should being using conda env commands. Unfortunately, this overlap of functionality is an artifact of ontogeny, namely, conda-env was originally a separate package that came after conda, and so conda remove -n envname --all was the original idiom for environment removal.
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