如何在远程开发中使用远程python解释器-VSCODE中的SSH



Microsoft最近发布了SSH的远程开发支持。

https://marketplace.visualstudio.com/items?itemname=ms-vscode-remote.remote-ssh

但是,在Python中,如果您单击"选择Python解释器"。可以选择的解释器仅适用于Anaconda中的一组Python口译员。

可供选择的解释器在:

~/anaconda3/*
/usr/bin/python

我在自定义位置有一个自定义的Python解释器。我的解释器在~/projects/myproject/bin/python

我们如何通过提供路径来配置远程python解释器?

注意:我已经配置了setting.json

"python.pythonPath": "${workspaceFolder}/bin/python",

,但似乎不尊重它

设法使其与

一起使用
  1. 更新VSCODE

  2. 我的文件:

# settings.json
{
  "python.pythonPath": "/custom/bin/python"
}
# launch.json
"configurations": [
  {
    "name": "Python: Current File",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "console": "integratedTerminal",
    "pythonPath": "${config:python.pythonPath}"
  },
...
  1. 重新启动VSCODE

  2. f1->选择解释器

最新更新