VSCode terminal shows incorrect python version and path, launching terminal from anaconda works perfectly

I have been facing the exact same problem. Finally found a workaround from a forum (https://github.com/Microsoft/vscode-python/issues/4434#issuecomment-466600591)

As long as you ADD some stuff to configuration, terminal.integrated.env.osx, the content will be appended to PATH after shell initialization(source bash_profile or zshrc). In my Mojave, I simply add following empty entry to my user configuration:

"terminal.integrated.env.osx": {
        "PATH": ""
}

Then the $PATH will be the same as the external terminal.


The officially accepted answer by @Samuel was the correct answer at the time.

But VS Code has now provided a better way to handle it.

In short, open up your user settings and add this line of code:

    "terminal.integrated.inheritEnv": false,

This prevents stomping over whatever Python environment manager you are using (eg, venv, conda, etc).