I just installed Anaconda on my Windows machine, but when I try to run any conda commands in the standard Command Prompt, I get an error saying it is not recognized. I followed the default installation settings, so I’m not sure why the terminal can't find the executable. Do I need to manually edit my system path variables, or is there a specific script I need to run to initialize the base environment?
3 answers
This error occurs because the Anaconda installation directory hasn't been added to your Windows PATH environment variables. During installation, there is an option to "Add Anaconda to my PATH," which is usually unchecked by default for stability. To fix this manually, you need to find your installation path—usually C:\Users\YourUser\Anaconda3—and add that folder, along with the \Scripts and \Library\bin subfolders, to your System Environment Variables. Once these three paths are added, restart your terminal. This ensures the Command Prompt knows exactly where to find the conda.exe file and its associated libraries when you call the command.
Have you tried using the "Anaconda Prompt" specifically instead of the default Windows CMD? It usually comes pre-configured with all the correct paths already initialized for you.
You likely just need to add the Scripts folder to your PATH. Once you apply the changes, make sure to close and reopen any active terminal windows.
I agree with Barbara; the PATH editor is where the magic happens. Just be careful not to delete any existing entries in your path while adding the new Anaconda directories!
That is a solid workaround, Steven, but most developers prefer using their integrated terminal in VS Code or a standard PowerShell window. To make it work everywhere, you really have to run conda init after manually adding the initial path to your environment variables. This command writes the necessary startup scripts to your shell profile, which handles the activation of the 'base' environment automatically every time you open a new session, saving you the hassle of manual configuration in the future.