Fix: ‘conda’ is not recognized as an internal or external command, operable program or batch file
“‘conda’ is not recognized as an internal or external command, operable program or batch file” indicates that the Command Prompt cannot find the conda program, blocking the use of Anaconda’s command-line tools. This is usually because the Anaconda folder isn’t included in the system’s PATH settings. The main cause is that the “Add to PATH” option was unchecked during installation.
A misconfigured or incomplete Anaconda setup can also lead to this error.
In this article, we will discuss different ways to solve this error.
1. Update Anaconda
Outdated Anaconda versions might lack necessary bug fixes or path settings, causing conda to not work in the Command Prompt. Updating to the latest version can resolve these issues and reset the PATH settings, allowing conda commands to run without manual changes. This ensures a stable and supported setup.
- Open the start menu and search for “Anaconda“. Click on Anaconda Prompt to launch it.
- In the Anaconda Prompt, run the following commands, pressing Enter after each one to update Conda:
conda update conda conda update anaconda
- Once the updates are complete, close Anaconda Prompt and open the Command Prompt (CMD) to check if you can run Conda commands successfully.
2. Add Anaconda To Your PATH Environment Variable During Installation
The issue might occur if you don’t select the “Add Anaconda to my PATH environment variable” option during installation. Without this, Windows can’t find the conda command, leading to the “command not recognized” error.
- Visit the Anaconda download page directly to get the latest distribution for your OS.
- Download the Anaconda installer for your preferred Python version.
- Run the installer, accept the Licence Agreement, and choose the default installation settings. Ensure you select “Add Anaconda to my PATH environment variable” under Advanced Options.
- After installation, open the Command Prompt and type “conda” to verify successful setup without errors.
3. Add the Conda Path Manually
If you don’t want to waste time uninstalling the entire Anaconda distribution, you can update (or verify) the environment variable associated with Conda yourself. But before doing so, it’s important to find the exact location of your Conda installation.
- Press Windows key + R, type “sysdm.cpl“, and press Enter to access System Properties.
- Go to the Advanced tab and click on Environment Variables…
- Select Path, click Edit, then New, and add:
C:\Users\*YourUser*\Anaconda3\Scripts C:\Users\*YourUser*\Anaconda3
- Note: Replace *YourUser* with your username. Adjust version numbers if necessary.
4. Avoid the Issue Without Adding Anaconda to the Environment Path
If you don’t want to change the PATH variable, use the Anaconda Prompt, which is set up for conda commands. This keeps Anaconda separate from other system settings and lets you run conda commands without affecting the global PATH.
- Open the Anaconda Prompt from the Start menu. This automatically configures conda commands without altering the global PATH.
- Once open, test if Anaconda is functioning by running:
conda --version