LinuxCommandLibrary

conda-rename

Rename a Conda environment

TLDR

Rename an environment via its name

$ conda rename [[-n|--name]] [current_name] [new_name]
copy

Rename an environment via its full path (i.e. prefix)
$ conda rename [[-p|--prefix]] [path/to/env] [new_name]
copy

SYNOPSIS

conda rename <old_name> <new_name>
conda rename [-h | --help]

PARAMETERS

<old_name>
    The current name of the conda environment you wish to rename.

<new_name>
    The desired new name for the conda environment.

-h, --help
    Displays a help message for the conda-rename command and exits.

DESCRIPTION

The conda-rename command is a utility designed to extend the functionality of the conda package manager, specifically for environment management. It allows users to rename existing conda environments, a feature that was not natively available in older conda versions. This capability is highly beneficial for organizational purposes, correcting naming errors, or adapting environment names to evolving project standards without the laborious process of recreating the environment from scratch. By providing a direct renaming mechanism, conda-rename significantly streamlines environment maintenance, saving time and effort, especially for environments containing numerous installed packages. While it originated as a community plugin, its utility led to the eventual inclusion of a native 'conda env rename' command in newer conda versions.

CAVEATS

conda-rename requires installation of a separate package (e.g., conda-env-mod) if not using conda versions where conda env rename is built-in.
It is generally recommended to deactivate the environment before renaming it to prevent potential issues.
Any scripts or configurations that hardcode the environment's path or name will need manual updates after renaming.
Compatibility and behavior may vary slightly depending on the specific plugin version or conda version being used.

BUILT-IN ALTERNATIVE

For conda versions 4.10.0 and above, the functionality to rename environments is natively available via the command: conda env rename <old_name> <new_name>. This built-in command is generally preferred over external plugins due to its better integration, maintenance, and reliability.

INSTALLATION (FOR OLDER CONDA OR SPECIFIC PLUGIN USE)

If you are using an older conda version or specifically require the functionality provided by the plugin, conda-rename can typically be installed by installing the conda-env-mod package: conda install conda-env-mod.

HISTORY

Historically, renaming a conda environment was not a direct feature, forcing users to resort to a manual process involving exporting, removing, and then recreating an environment under a new name. The conda-rename command emerged as a popular community-contributed plugin, often bundled with packages like conda-env-mod, to address this significant limitation. Its widespread adoption highlighted the demand for such a feature, eventually leading to the inclusion of a native conda env rename command in conda versions 4.10.0 and later, effectively making the external conda-rename plugin less necessary for modern conda installations.

SEE ALSO

conda(1), conda env(1), conda create(1), conda remove(1)

Copied to clipboard