VSCode Python version defaults to 2.7 in the integrated terminal no matter what I do

前端 未结 1 562
予麋鹿
予麋鹿 2021-01-14 07:07

I\'m running VSCode 1.36.0 on MacOS Mojave 10.14.6.

When I use the integrated terminal in VSCode and run Python it always runs Python 2.7 from /us

相关标签:
1条回答
  • 2021-01-14 07:12

    Get the shell path of your default terminal by executing echo $SHELL this should output something like /bin/bash

    now check if the VSCode integrated Terminal points to the same shell and if not, set the integrated shell of VSCode to the one of your terminal.

    Edit (to provide the full solution):

    vsCode runs every new shell as login shell so if you set the Anaconda Path in .bashrc it will not be set in the integrated shell. If this is the case, you can set "terminal.integrated.shellArgs.osx": [] to force vsCode to run a non Login shell and load .bashrc

    0 讨论(0)
提交回复
热议问题