Skip to main content
v2026.11,986 entries · CC-BY 4.0

How to Add Conda to PATH (Windows, macOS, Linux)

Add conda to PATH with conda init or –condabin, preview it with –dry-run and undo it with –reverse, on Windows, macOS and Linux.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

To add conda to your PATH, run conda init from a shell where conda already works (or conda init --condabin if you only want the conda executable on PATH), then close and reopen your terminal. The conda documentation prefers this route over editing the PATH variable by hand, and on Windows it describes the installer option to add Anaconda to PATH as available only for a Just Me install. This guide covers each route on Windows, macOS and Linux, shows how to preview and undo the change, and lists the failures that make conda look missing.

What adding conda to PATH does

PATH is the ordered list of folders your shell searches when you type a command. If the folder holding the conda executable is not on that list, the shell cannot find conda, even though the software is installed. For research work this shows up as a broken analysis environment: you cannot create or activate the environments that pin a project’s Python and package versions (see how to make a new conda environment).

There are two different things people mean by “adding conda to PATH”, and the documentation treats them differently:

  • Shell initialization. The conda activation guide states that conda init initializes a shell permanently by writing shell code in the relevant startup scripts of that shell (for example ~/.bashrc). This is what makes conda activate and conda deactivate work, because those commands change shell state such as environment variables.
  • The condabin folder only. The --condabin option adds only the condabin/ directory to PATH and does not install the shell function. That directory contains the conda executable, not the other tools in the base environment.

Why conda’s own docs discourage a full PATH entry

The conda troubleshooting page explains the underlying risk on Windows. Windows relies on PATH to locate libraries, and it searches the folders from left to right. Putting Anaconda’s folders on PATH adds several of them (the install root, Library/mingw-w64/bin, Library/usr/bin, Library/bin, Scripts, bin and condabin), which can break other software that finds the wrong library first. The same page notes that newer Pythons require environments to be activated. That is why the narrower conda init and --condabin routes exist.

The Windows install page adds a security point: as of Anaconda Distribution 2022.05 and Miniconda 4.12.0, the option to add Anaconda to the PATH environment variable during an All Users installation has been disabled, to address a security exploit. You can still add Anaconda to PATH during a Just Me installation.

How to install or access it

Conda ships with Anaconda Distribution and Miniconda, and the installation instructions live in the conda user guide at docs.conda.io (Windows, macOS and Linux pages). If you have not installed it yet, follow installing Anaconda for Python and then return here only if the conda command is not found. Everything below assumes conda is already installed on disk and you know its install location (the folder that contains condabin and bin or Scripts).

Step-by-step: add conda to PATH

Windows

  1. Open the conda command prompt that the installer put in the Start menu (the Windows install page describes using the Start menu after installation and the Anaconda Command Prompt, cmd.exe, for Miniconda and Anaconda Distribution). Conda already works there without any PATH change.
  2. Preview the change: conda init --dry-run. The -d, --dry-run option only displays what would have been done.
  3. Apply it: conda init. With no shell named, the default on Windows is cmd.exe and PowerShell. To name a shell explicitly, use conda init powershell.
  4. If you want only the executable on PATH, use conda init --condabin instead. On CMD this changes PATH in the registry.
  5. Close every open terminal and open a new one. The docs state that most shells need to be closed and restarted after conda init for the change to take effect.

If you are running the graphical installer, the option to add Anaconda to PATH is offered only for a Just Me installation. For a scripted install, the documented silent-install arguments are /InstallationType=[JustMe|AllUsers] (default JustMe), /AddToPath=[0|1] (default 0), /RegisterPython=[0|1] (makes this the system’s default Python), /S (silent mode) and /D= followed by the installation path, which must be the last argument. Per the docs these arguments are case-sensitive.

macOS and Linux

  1. If conda is not yet on PATH in any shell, activate the base environment from the install location: source /path/to/conda/bin/activate. The macOS install page gives exactly this as the first step to initialize after the installer has finished.
  2. Then run conda init --all to initialize every currently available shell, or name one: conda init bash or conda init zsh. With no shell named, the default on Unix is bash.
  3. Close and reopen the terminal window, as the macOS page instructs, so the startup-script changes take effect.

fish shell

The Linux install page gives two commands for fish: add the conda binary to $PATH if it is not already there with fish_add_path CONDA_INSTALL_LOCATION/condabin, then configure fish with conda init fish.

Choosing the scope: user or all users

--user initializes conda for the current user and is the default. --system initializes it for all users on the system. The activation deep-dive names the matching code paths (init_sh_user and init_sh_system for POSIX shells, init_fish_user, init_xonsh_user and init_cmd_exe_registry for CMD through the Windows registry), which is a useful clue when you need to find where a change was written.

Output and how to read it

After you reopen the terminal, verify the result. The conda install pages for Windows and macOS give conda list as the check: a list of installed packages appears if conda is installed correctly.

The activation deep-dive shows what a working setup does when you activate an environment: it appends condabin to PATH and prepends the environment’s bin folder, so the environment’s programs are found before system-wide ones. If you used --verbose with conda init, the exact changes are printed; --dry-run lists the files that would be affected without changing them. Use --json if a script needs machine-readable output.

Troubleshooting

The shell says conda is not recognized or not found

This means the folder with the executable is not on PATH in that shell. Work through these in order: confirm you opened a new terminal after conda init; confirm the shell you are using is one that was initialized (conda init with no argument covers only bash on Unix, and cmd.exe and PowerShell on Windows, so zsh, fish, tcsh and xonsh need to be named or covered with --all); then run conda init --dry-run to see which files it would touch.

Conda was installed for All Users on Windows

The PATH option is disabled for that install type, so use conda init or reinstall as Just Me if you specifically need the PATH entry from the installer.

Other software broke after adding Anaconda’s folders to PATH

This is the library search-order problem described above. Undo the change with conda init --reverse (it undoes the effects of the last conda init), or on Unix conda init --reverse --all as the Linux and macOS uninstall instructions describe for undoing changes to shell initialization scripts, and use --condabin instead.

You want conda available without changing shell startup files

The macOS silent-install option -b runs batch mode with no PATH modifications and does not edit scripts such as .bashrc, .bash_profile or .zshrc. You can then run conda init later.

Options compared

Every method here is free and documented by the conda project; none requires paid software. The table sets the routes side by side. A second, sourced data table of the conda init options follows the article.

Method Platform What it changes Source page
conda init [shell] All Writes shell code into the shell’s startup scripts; CMD uses the registry conda init and activation docs
conda init --condabin All Adds only condabin/ to PATH; no shell function conda init docs
fish_add_path CONDA_INSTALL_LOCATION/condabin fish on Linux Adds condabin to $PATH if not yet added Linux install docs
Installer PATH option or /AddToPath=1 Windows, Just Me only Adds Anaconda to the PATH variable at install time Windows install docs
source /path/to/conda/bin/activate then conda init --all macOS Initializes after install; every available shell macOS install docs

After conda works: next steps for reproducible research

Once conda resolves in a new terminal, keep your tool chain current with updating conda, understand the channel you install from in conda-forge, and record the environment so collaborators can rebuild it: see sharing a reproducible conda environment. If you are unsure whether you need Anaconda or plain Python, read the differences between Python and Anaconda.

Frequently asked questions

Should I add Anaconda to PATH on Windows?

Only if you have a reason to. The docs offer the PATH option for Just Me installs only, and the troubleshooting page warns that putting Anaconda’s several folders on PATH can break other software. Running conda init or using the conda command prompt avoids the broad PATH entry.

What is the difference between conda init and conda init –condabin?

conda init installs shell code so activation works. --condabin adds only the condabin/ directory to PATH and does not install the shell function.

How do I undo conda init?

Run conda init --reverse, which undoes the effects of the last conda init. The Linux and macOS install pages give conda init --reverse --all to undo changes to shell initialization scripts.

Why do I have to reopen the terminal?

Because conda init edits startup files and the registry; a shell that is already running has read its configuration and does not see the change. The docs state most shells must be closed and restarted.

Sources

Data: conda init options and what each changes

Compares the documented conda init options by scope of change, default behavior and how to reverse them, compiled from the official conda command reference and install guides.

conda init options and what each changes
Option or commandWhat it doesScope or defaultRelated undo or preview
conda initInitializes the shell by writing shell code to its startup scriptsDefault shells: bash on Unix; cmd.exe and PowerShell on Windowsconda init --reverse
conda init --condabinAdds the condabin/ directory to PATH only; does not install the shell functionPATH only; on CMD the registry is changedconda init --reverse
conda init --allInitializes all currently available shellsCurrent user (default --user)conda init --reverse --all
conda init --systemInitializes conda for all users on the systemAll usersconda init --dry-run to preview
conda init --userInitializes conda for the current userDefaultconda init --dry-run to preview
conda init --dry-runOnly displays what would have been doneNo changes madeNot needed

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about How to Add Conda to PATH (Windows, macOS, Linux)

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →