To rename a
conda env listcommand if you need to get the name of the environment.
conda env list
conda rename -n old_name new_namecommand to rename the environment.
The following example runs the command in with the
--dry-run option to test
the expected behavior.
conda rename -n old_name --dry-run new_name
Once you're ready to run the real command, remove the
conda rename -n old_name new_name
conda rename command renames a conda environment via its name.
--name) option is used to specify the current name of the
--dry-run) option is set, the command only displays what would
have happened if you had run it without the flag but it doesn't actually change
the environment's name.
Note that you can't rename the
condaenvironment by creating a new one and cloning it
If you use an older
conda version ( < 4.14), you might have to rename the
environment in a couple of steps:
Note that you can't rename a
conda environment that is currently active.
conda create --name new_name --copy --clone old_name
conda env remove --name old_name
However, when using this approach,
conda would have to re-download the
installed packages, so it is less performant than using
There is no good reason to create a new environment and clone the old one if you
conda version > 4.14 and are able to use
You can learn more about the related topics by checking out the following tutorials: