Command referenceconda rename
conda rename command (Linux & Windows / Conda)
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 / option | Meaning |
|---|---|
| -n, --name | Current environment name. |
| -p, --prefix | Current environment prefix. |
| NEW_NAME | Desired new environment name. |
| -y, --yes | Skip 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.
Related commands
- conda env listList all Conda environments and mark the currently active one.
- conda createCreate a new isolated Conda environment with an optional Python version and starter packages.
- conda env removeDelete a Conda environment and all packages installed inside it.
- conda activateActivate a named or path-based Conda environment in the current shell session.
- conda installInstall packages into the active or named Conda environment from configured channels.
- conda listList packages installed in the active or named Conda environment.
- aptSearch, install, update, and remove packages on Debian-based systems.
- conda env createCreate an environment from an environment.yml (or similar) specification file.
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.