I am using Microsoft Visual Studio Code 1.30.2 on macOS Mojave 10.14.3. In the settings of VS Code, I have required it to use the external Terminal.app application on macOS. I also have an Anaconda distribution of Python installed.
Note that the PATH variable here reads:
~ » $PATH
bash: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/anaconda3/bin:/anaconda3/condabin: No such file or directory
The order above is different from what I get if I fire up the regular Terminal app and get the PATH.
~ » $PATH
-bash: /anaconda3/bin:/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin: No such file or directory
What this effectively does is switch the versions of Python when I type in python in the two cases. In the regular terminal, I get Python 3 right away, whereas in VS Code, I am faced with Python 2.
How do I change the PATH in VS Code so that whenever I type the words python, I am always given Python 3 instead of 2?
P.S. Please note that while editing Python code in VS Code, I can always select which interpreter I want to use, but that does not change the situation with the terminal underneath.


pythonin vscode instead of launching it through a shell? You can specify its path in the configuration.pythonin vscode, it first looks in the/usr/bin/directory which contains a distribution of Python 2 that is used by macOS internally; whereas when I typepythonin the external terminal app, it first looks for python in/Anaconda3/bin/which contains a distribution of python 3. The order of where to look is defined in a variable called PATH. Somehow vscode uses a different PATH and messes up the order. I want to know where its definition is located, so that I can fix it./usr/bin/could mess things up with macOS.