Skip to main content

Command referenceconda rename

conda rename command (Linux & Windows / Conda)

Linux & WindowsCondapackageintermediate

What it does

Rename an existing Conda environment without recreating it from scratch. When people look up conda rename environment, they usually want safe flags, copyable examples, and how this Conda subcommand fits Anaconda or Miniconda workflows on Linux, Windows, and macOS. Syntax, options, and practical examples are below.

Rename an existing Conda environment without recreating it from scratch.

Syntax

conda rename [-n ENV | -p PATH] NEW_NAME

Common options

Flag / optionMeaning
-n, --nameCurrent environment name.
-p, --prefixCurrent environment prefix.
NEW_NAMEDesired new environment name.
-y, --yesSkip confirmation.

Practical examples

Rename by name

conda rename -n old-ml ml

Renames old-ml to ml.

From prefix

conda rename -p ./envs/demo demo-v2

Registers a clearer name for a path-based env when supported.

Non-interactive

conda rename -n tmp experiments -y

Renames without a prompt.

Common mistakes

  • Renaming an active environment in the same shell — deactivate first.
  • Assuming rename rewrites every hardcoded absolute path inside installed packages.

FAQ

What does conda rename do in Conda?

Rename an existing Conda environment without recreating it from scratch.

Does conda rename work on Windows and Linux?

Yes. Conda runs on Linux, Windows, and macOS; shell activation differs slightly after `conda init`, but the CLI flags are the same.

What is a practical conda rename example?

Try `conda rename -n old-ml ml` — Renames old-ml to ml.

Is mamba the same as conda rename?

Mamba is a faster drop-in solver for many Conda workflows. Prefer `mamba` only when it is installed; otherwise use the Conda commands on this page.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.