Command referenceconda init
conda init command (Linux & Windows / Conda)
What it does
Configure shell startup files so `conda activate` works in bash, zsh, PowerShell, cmd.exe, and others. When people look up conda init shell, 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.
Configure shell startup files so `conda activate` works in bash, zsh, PowerShell, cmd.exe, and others.
Syntax
conda init [SHELL ...]
Common options
| Flag / option | Meaning |
|---|---|
| bash | Modify bash startup files. |
| zsh | Modify zsh startup files. |
| powershell | Configure PowerShell profiles. |
| cmd.exe | Configure Command Prompt on Windows. |
| --reverse | Undo init changes for the given shells. |
| --all | Initialize all detected shells. |
Practical examples
Bash setup
conda init bash
Enables conda activate in new bash sessions after a restart.
PowerShell
conda init powershell
Hooks Conda into the current user's PowerShell profile.
Multiple shells
conda init bash zsh
Configures both shells in one go on macOS/Linux.
Undo
conda init --reverse bash
Removes Conda's block from bash startup files.
Common mistakes
- Forgetting to open a new terminal after init — existing sessions keep the old PATH.
- Running init in CI for every job when `conda run` would be enough.
Related commands
- conda activateActivate a named or path-based Conda environment in the current shell session.
- conda deactivateLeave the current Conda environment and restore the previous shell PATH stack.
- conda runRun a command inside a Conda environment without permanently activating it in the parent shell.
- conda infoShow Conda installation details, active environment, channels, and platform metadata.
- conda createCreate a new isolated Conda environment with an optional Python version and starter packages.
- conda installInstall packages into the active or named Conda environment from configured channels.
- conda listList packages installed in the active or named Conda environment.
- conda env listList all Conda environments and mark the currently active one.
FAQ
What does conda init do in Conda?
Configure shell startup files so `conda activate` works in bash, zsh, PowerShell, cmd.exe, and others.
Does conda init 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 init example?
Try `conda init bash` — Enables conda activate in new bash sessions after a restart.
Is mamba the same as conda init?
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.