In my console (iterm2)
which python gives /Users/anders/anaconda3/bin/python
In Visual Studio Code's built in terminal
which python gives /usr/bin/python
Since I want to use anacondas python installation I use CMD+SHIFT+P(Python: Select Interpreter) and there I see ~/anaconda3/bin/python so I select that one.
However this does not take effect in my terminal. I have tried the following to make it reflect when doing which python
- Open a new terminal tab
- Restart program
And if I go back to confirm active interpreter, it does say anaconda. But still it uses the one from /usr/bin/python. Whats going on here?
update
echo $PATH in visual studio code
/usr/local/opt/node@8/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
~/bin:
/Users/anders/anaconda3/bin:
/usr/local/opt/node@8/bin:
/Users/anders/.composer/vendor/bin:
/Users/anders/.composer/vendor/bin
echo $PATH in iterm2
/Users/anders/anaconda3/bin:
/usr/local/opt/node@8/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
~/bin:
/Users/anders/.composer/vendor/bin
So VS code does something to my PATH but I don't see the pattern.
echo $SHELL gives /bin/bash
Putting export SHELL="/Applications/iTerm.app/Contents/MacOS/iTerm2" in my bash_profile does make VS code to open iterm2 on CMD+ALT+C, but not when switching to the integrated terminal.
I put the following settings in Visual studio code settings (CMD+,)
Terminal: Explorer KindexternalTerminal>External: Osx Exec/Applications/iTerm.app/Contents/MacOS/iTerm2
Also tried
Terminal: Explorer KindintegratedTerminal>External: Osx Exec/Applications/iTerm.app/Contents/MacOS/iTerm2
but both of them spawns a new iTerm window that is not integrated.
$PATHenvironment variable is order specific. In your example where it is working, the$PATHhas/Users/anders/anaconda3/binbefore/usr/bin. Try setting the$PATHof visual studio code to have your Anaconda directory as the first path and then see if you get the behavior you are expecting.