我安装了VSCode,下载了官方Python 3.6.4.
检测到VSCode并将环境设置为正确 - 我确实看到"python.pythonPath"用户设置设置正确.
但是,使用VS代码中使用,当Ctrl+ F5运行Python文件,我一直在问的"选择环境",它表明了我两个选择-的Python - Python的实验
什么是"Python实验"?每次尝试运行脚本时,如何摆脱中断?
我想设置默认的 python 解释器路径,以避免每次登录远程服务器时都被询问。
我尝试过这个类似答案中的方法。我的workspace.json 现在看起来像:
{
"folders": [
{
"uri": "vscode-remote://ssh-remote+172.1.1.1/home/user/workspace/folder1"
},
{
"uri": "vscode-remote://ssh-remote+172.1.1.1/home/wzy/workspace/folder2"
}
],
"remoteAuthority": "ssh-remote+172.1.1.1",
"settings": {
"python.defaultInterpreterPath": "/home/user/miniconda3/envs/py38/bin/python",
}
}
Run Code Online (Sandbox Code Playgroud)
但是每次重新连接到服务器时,我都需要手动选择 python 解释器(否则/user/bin/python3将选择基本解释器)