Skip to main content

Command referenceconda init

conda init command (Linux & Windows / Conda)

Linux & WindowsCondapackagebeginner

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 / optionMeaning
bashModify bash startup files.
zshModify zsh startup files.
powershellConfigure PowerShell profiles.
cmd.exeConfigure Command Prompt on Windows.
--reverseUndo init changes for the given shells.
--allInitialize 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.

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.