samol
samol

Reputation: 20590

How to use a remote python interpreter in remote development - ssh in VSCode

Microsoft recently released remote development support for SSH.

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

However, in python, if you click "select python interpreter". The interpreter available to be chosen is only for a set of python interpreters in anaconda.

The interpreter available to be chosen are in:

~/anaconda3/*
/usr/bin/python

I have a custom python interpreter in a custom location. My interpreter is in ~/projects/myproject/bin/python

How do we configure a remote python interpreter by giving it a path?

Note: I have configured setting.json

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

But it does not seem to respect it

Upvotes: 1

Views: 5126

Answers (1)

Pav K.
Pav K.

Reputation: 2858

managed to make it work with

  1. update vscode

  2. my files:

# 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. restarted vscode

  2. F1 -> select Interpreter

Upvotes: 1

Related Questions