How to Fix “conda is Not Recognized” Error on Windows: A Complete Guide

1. The Problem: Conda Works in Anaconda Navigator, But Fails Elsewhere

For many Python developers who use Anaconda to manage virtual environments, a common frustration arises: the `conda` command works perfectly in Anaconda Navigator’s built-in terminal, but throws an error—*”conda is not recognized as an internal or external command, operable program or batch file“*—when used in Windows Command Prompt (CMD) or Visual Studio Code (VSCode) terminal.

Let’s verify this issue with practical tests:

  1. In Anaconda Navigator, locate your created virtual environment (e.g., My-Python-Env), click the arrow next to it, and select “open terminal” to launch a dedicated command window.
  2. Type `conda env list` in this window; it will display all your Anaconda virtual environments (e.g., base and My-Python-Env, with an asterisk marking the currently active one).
  3. Open Windows Search, type “CMD”, and launch the system Command Prompt. Type `conda env list` here—you’ll get an error immediately.
  4. Open VSCode, ensure you’ve selected the Python interpreter from My-Python-Env (e.g., My-Python-Env\python.exe). Click “View” > “Terminal”, switch the terminal type from PowerShell to Command Prompt, and type `conda env list`—the same error appears.
  5. Why does the same command work only in Anaconda’s terminal? It’s not a tool bug; the Windows system simply “can’t find” the path to the conda executable.

2. The Root Cause: Conda Path Is Missing from Windows Environment Variables

The core reason for this error is that the path to Anaconda’s executable files (including conda) is not added to the Windows “Environment Variables Path”.

Think of the Environment Variables Path as the system’s “navigation directory”: when you type a command (like `conda`) in any terminal, Windows automatically searches for the corresponding executable file in the paths listed in Path. If it can’t find the file, it returns a “command not recognized” error.

By default, Anaconda does not add the conda path to the system Path during installation. This means only Anaconda’s built-in terminal can “locate” conda accurately, while tools like CMD and VSCode can’t call conda because they lack the “navigation address”.

To fix the problem, you only need two key steps: first, find the exact path to conda, and second, add this path to the system Environment Variables Path.

3. Step 1: Locate the Core Path of Conda (Detailed Steps)

Before adding the path, you need to find where conda is stored. Using the Anaconda Navigator shortcut, you can easily locate the installation path. Here are the detailed steps:

  1. Click the Windows Start Menu, find “All Apps”, and expand the “Anaconda” folder.
  2. Right-click the “Anaconda Navigator” icon, select “More” from the pop-up menu, then click “Open file location”.
  3. A File Explorer window will open, showing that “Anaconda Navigator” is a shortcut (not the actual program).
  4. Right-click this shortcut, select “Properties”, and the “Target” text box will display a path (e.g., “C:\Users\Hello\anaconda3\pythonw.exe”).
  5. Press `Ctrl+A` to select all text in the “Target” box, press `Ctrl+C` to copy it, and paste it into a text editor like Notepad.
  6. From the pasted path, extract Anaconda’s installation root directory—the folder containing “pythonw.exe” (e.g., “C:\Users\Hello\anaconda3”).
  7. Open File Explorer, paste the root directory path, and navigate to it. Look for the “condabin” subfolder in the directory.
  8. Enter the “condabin” folder and confirm that it contains the “conda.bat” file (the executable file for the conda command). Then copy the full path of “condabin” (e.g., “C:\Users\Hello\anaconda3\condabin”)—this is the core path to add to the environment variables.

4. Step 2: Add the Conda Path to System Environment Variables

Once you have the path, you just need to add it to the Environment Variables Path via Windows Settings. Here are the detailed steps:

  1. Click the Windows Start Menu, find and click “Settings” (gear icon).
  2. In the Settings window, click “System” on the left sidebar.
  3. Scroll down the right panel to the bottom and click “About”.
  4. In the About window, click “Advanced system settings” (located at the bottom of the left navigation bar).
  5. The “System Properties” window will pop up. Switch to the “Advanced” tab and click the “Environment Variables” button at the bottom.
  6. In the “Environment Variables” window, find the “System variables” section (not “User variables”), locate the “Path” variable in the list, select it, and click “Edit”.
  7. The “Edit environment variable” window will pop up. Click the “New” button on the right, and paste the “condabin” path you copied earlier (e.g., “C:\Users\Hello\anaconda3\condabin”) into the blank box.
  8. Click “OK” to save the new path, then click “OK” in all open windows (3 times total, to close “Edit environment variable”, “Environment Variables”, and “System Properties” respectively)—the environment variable setup is now complete.

5. Verification: Test Conda in CMD and VSCode Terminals

After setting up, you need to verify if it works. Note: After modifying environment variables, you must restart any open CMD or VSCode windows to recognize the new path. Here’s how to verify:

5.1 Verify CMD Terminal

  1. Close all open CMD windows and launch a new one.
  2. Type `conda env list` in CMD and press Enter.
  3. If it displays all Anaconda virtual environments (e.g., base and My-Python-Env) correctly, the setup is effective.

5.2 Verify VSCode Terminal

  1. Close VSCode completely (not just minimize it) and restart it.
  2. Open a Python file (or create a new one) and ensure the interpreter is still the My-Python-Env you selected earlier.
  3. Click “View” in the top menu bar of VSCode and select “Terminal”.
  4. If the terminal type is PowerShell, click the downward arrow in the upper right corner of the terminal and select “Command Prompt” to switch.
  5. Type `conda env list` in the terminal and press Enter.
  6. If it displays the list of virtual environments correctly, VSCode can now recognize the conda command.

6. Conclusion: One Core Issue, Two Steps to Fix, Universal for All Tools

The “conda command not recognized” error is actually simple to resolve—the core issue is “the system can’t find the path”. By following the two steps of “locating the condabin path → adding it to environment variables”, you can make tools like CMD and VSCode call conda normally, enabling cross-tool management of Anaconda virtual environments.

If you still get errors after operation, check two things: first, ensure the path is copied correctly (it should be the “condabin” directory, not the root directory), and second, ensure you’ve restarted the terminal or VSCode (environment variable changes require a restart to take effect). Following these steps, even beginners can fix the problem in 10 minutes and get rid of the limitation of “only using conda in Anaconda Navigator”.

7. Demo Video

You can watch the following demo video by select the subtitle to your preferred subtitle language.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top