Fix: ‘conda’ is not recognized as an internal or external command, operable program or batch file
Several users are encountering the “conda is not recognized as an internal or external command, operable program or batch file” when trying to run any Anaconda command using Command Prompt.
What is causing the ‘conda’ is not recognized as an internal or external command error?
We investigated this particular issue by trying to recreate de error on our machine and by looking at other user reports. Based on what we gathered, there are several scenarios that will trigger this particular error message:
- Environment PATH for Conda is not set – This is the most common cause why this issue occurs. Keep in mind that the latest Anaconda builds will not automatically add Conda to your System variable paths since it can cause various issues with other software.
- Environment PATH is incorrectly added – Another popular reason why this issue occurs is to user fault when trying to add the Environment PATH variable manually.
- Anaconda version is older than the version of the Anaconda Navigator – Some users have reported that the error was no longer occurring after updating Conda to the latest version.
Method 1: Updating Anaconda to the latest version
Several users have reported that the issue was resolved and they were able to run conda commands inside the Command Prompt after updating Conda to the latest version.
As it turns out, you can experience this problem in the event that you’re using a newer Anaconda Navigator version with an older Conda version. Here’s a quick guide on how you can rectify this:
- Access your start menu in the bottom-left corner and search for “anaconda“. Then, click on Anaconda Prompt.
- Inside the Anaconda Prompt program, run the following commands and press Enter after each one to update Conda to the latest version:
conda update conda install
- Wait until the process is complete, then close the Anaconda Prompt and open a CMD window. See if you’re now able to run Conda commands.
If you’re still encountering the “conda is not recognized as an internal or external command, operable program or batch file” error, move down to the next method below.
Method 2: Adding Anaconda to your PATH environment variable during installation
The quickest way to resolve this issue automatically is to reinstall Anaconda and use one advanced option that will all the Anaconda to your PATH environment variable automatically. But keep in mind that using this method might mean that you encourage certain application to conflict with your Anaconda installation.
In any case, if you’re looking for a way to add Anaconda to your PATH environment automatically, follow the steps down below:
Note: If Anaconda is not installed on your computer, skip straight to step 3.
- Press Windows key + R to open up a Run dialog box. Then, type “appwiz.cpl” and press Enter to open Programs and Features.
- Inside Programs and Features, scroll down through the application list and locate the Anaconda distribution. Next, right-click it and choose Uninstall, then follow the on-screen prompts to uninstall it from your system.
- Visit this link (here) and download the latest Anaconda distribution by clicking o an icon associated with your operating system.
- Select the appropriate Python version that you want to use with Anaconda by clicking it’s associated Download button.
- Open the installation executable, hit Next at the first prompt, then accept the Licence Agreement.
- Select the installation type and hit Next once again.
- Choose the Destination Folder and click the Next button again. We highly recommend that you keep the default location.
- This step is crucial. In the Advanced Installation Options, check the box associated with Add Anaconda to my PATH environment variable (under Advanced Options) and click Install.
- Once the installation is complete, type “conda” inside a Command Prompt. You should no longer see the “conda is not recognized as an internal or external command, operable program or batch file” error.
If this method wasn’t effective or you’re looking for a different approach that doesn’t involve reinstalling the whole Anaconda distribution, move down to the next method below.
Method 3: Adding the Conda path manually
If you don’t want to waste time on uninstalling the whole Anaconda distribution, you can update (or verify) the environment variable associated with Conda yourself. But before doing so, it’s important to find out the exact location of your Conda installation.
Follow the guide down below to discover and adjust the Conda PATH manually in Environment Variables:
- Access the start menu (bottom-left corner) and search for “anaconda prompt“. Then, click on Anaconda Prompt and wait for the program to open.
- Inside the Anaconda Prompt program, run the following command and press Enter to check the location of Conda:
where conda
- Copy the second location previously fetched at step 2, but exclude the executable. For example: C:\Users\madro\Anaconda3\Scripts
- Press Windows key + R to open up a Run dialog box. Then, type “sysdm.cpl” and press Enter to open up the System Properties screen.
- Inside the System Properties window, go to the Advanced tab and click on Environment Variables…
- Inside the Environment variables for *YourUser* window, select the Path variable and click the Edit button.
- Inside the Edit environment variable window, click the New button. Then, add these two locations:
C:\Users\*YourUser*\Anaconda3\Scripts C:\Users\*YourUser*\Anaconda3
Note: Keep in mind that *YourUser* is only a placeholder. Replace it with your own username. Also, if you’re using an older Anaconda version, change the version number accordingly.
Method 4: Circumventing the issue without adding Anaconda to Environment Path
If you want to avoid adding the Anaconda path to the Environment variables, you can type Conda commands without getting the “conda is not recognized as an internal or external command, operable program or batch file” error by using Command Prompt to navigate to the folder installation first.
But keep in mind that this is not very practical since you’ll have to repeat this procedure whenever you open a new Command Prompt.
If you decide to circumvent the error by adding the Anaconda path to your CMD window, here’s what you need to do:
- Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Enter to open up a Run dialog box.
- Inside the CMD window, type CD followed by the path to your Anaconda folder installation. Unless you installed Anaconda in a similar location, it’s should be something similar to :
CD C:\Users\*YourUser*\Anaconda3\Scripts
- Run a command to test Anaconda and see if it’s functioning properly inside Command Prompt. You can use this command:
conda --version