DEV Community

Cover image for Resolving 'conda' Not Recognized Error in VS Code and Anaconda Integration with PowerShell
Ashwin Kumar
Ashwin Kumar

Posted on

Resolving 'conda' Not Recognized Error in VS Code and Anaconda Integration with PowerShell

Are you encountering the frustrating "The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program" error while working with Visual Studio Code and Anaconda integration? Fear not, as I've been through the same issue, and I'm here to guide you through a step-by-step solution. Stick with me, and let's get your setup back on track.

Step 1: Open the Integrated PowerShell Terminal in Visual Studio Code

To begin resolving the issue, open the integrated PowerShell terminal in Visual Studio Code.

Step 2: Check Your Current PATH Environment Variable

Run the following command to check your current PATH environment variable:

$env:PATH
Enter fullscreen mode Exit fullscreen mode

If C:\Users\YourUsername\Scripts is not included in the PATH, you can add it using the following command:

$env:PATH += ";C:\Users\YourUsername\Scripts"
Enter fullscreen mode Exit fullscreen mode

This command appends the Conda Scripts directory to the PATH.

Step 3: Verify the PATH Modification

Confirm that the path has been added by running:

$env:PATH
Enter fullscreen mode Exit fullscreen mode

Ensure that C:\Users\YourUsername\Scripts is now part of the PATH.

Step 4: Try Running Conda Again

Execute the following command to check if the issue persists:

conda --version
Enter fullscreen mode Exit fullscreen mode

If everything is set up correctly, this command should now work without the "not recognized" error.

Remember, if you close the Visual Studio Code session, you might need to repeat these steps unless you add the PATH modification to your PowerShell profile.

Step 5: Troubleshooting and Additional Considerations

If the issue persists, double-check your Conda installation and ensure that the Scripts directory contains the necessary Conda executables.

Note: Replace "YourUsername" with your actual username. If you're unsure how to find it, open the Anaconda prompt and enter the command where conda to retrieve your paths.

Happy Coding!

Top comments (0)