1

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

1
  • Add "python": "path/to/python" in launch.json Commented Jun 11, 2022 at 10:29

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

For me, using the Microsoft "Remote - SSH" package, I just needed to switch the python interpreter from the server default by doing F1 -> Python: Select Interpreter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.