Choosing an environment By default, the Python extension relies on the
first Python interpreter it finds in the path, but it's easy to switch
between environments.
To use a specific interpreter, select the Python: Select Interpreter
command from the Command Palette (Ctrl+Shift+P).
“文件”>;“首选项”>;“设置”>;“用户”选项卡>“扩展”>;“python”>;“python路径”
键入python路径,例如:
c:\python35\python.exe
一旦您选择了一个解释器,它应该存储在设置.json在.vscode文件夹中。应该是这样的:
下次使用vscode打开此文件夹时,应该自动选择上次使用的python解释器。在
也许你没有用“打开文件夹”打开工作目录。然后vscode会尝试读取local.vscode文件夹(如果有的话),否则它会按照一定的路径顺序来选择解释器。希望有帮助。在
按ctrl+shift+p启动命令托盘和
输入python解释器,您将得到一个选择解释器的选项
然后选择python解释器
相关问题 更多 >
编程相关推荐