I mainly use VSCode and Anaconda for my Python Development. I’ve always been more comfortable with bash scripting rather than powershell, so my default terminal is Git Bash (for Windows). Outside of VSCode, things run smoothly, but if I want to execute a script in a different environment, my terminal can’t seem to find the conda command.
As you can see, if I run which conda
it returns the correct path. But if I try to just execute conda
it tries to use a path that starts with /cygdrive/. I’ve deleted that a while ago, and conda works just fine in my external terminals just fine. This only occurs in VSCode’s integrated terminal. Any idea how to fix this?
I’ve tried searching through the terminal settings in VSCode but can’t seem to find a proper setting. If possible I’d like to avoid a reinstall.
2
Answers
In the second case it’s trying to run
conda.exe
but the returned path just ended withconda
with no explicit file ending. Command prompts can get very fussy about that sort of stuff, and since MinGW is supposed to emulate Unix to a degree, there’s a chance that theconda
file isn’t actually an.exe
file to begin with. Make sure there’s specifically aconda.exe
file in yourScripts
folder.This may be related to your environment variables, make sure the conda path already exists in the environment variable
path
. In addition, you can also add parameters to the terminal using the following setting in vscode.