Conda environments are defined by the packages installed in them and extra metadata like which channels to use, channel priority, the subdir (whether to use osx-64
or osx-arm
).
I would like to uninstall only the packages but keep the environment configuration alive.
I know I can delete the entire environment with conda remove --all -n ENV_NAME
- but using this command I loose the metadata.
It is quite likely that no conda
CLI command exists to do what I want (at least conda remove
doesn't seem to do this). But is there a workaround, maybe listing all packages and feeding them to conda remove -n ENV_NAME [PACKAGE_NAME ...]
.
I opened a feature request to add an option to keep empty environments around: https://github.com/conda/conda/issues/12485