Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
899 views
in Technique[技术] by (71.8m points)

visual studio code - Can I add a remote Python interpreter (via SSH) to a local VSCode environment (i.e. a hybrid local/remote SSH setup)?

I have VSCode set up with the "Remote - SSH" extension, and I am able to run a local VSCode window as the face of a full remote environment. Really cool.

However, I would also like to be able to set up a local VSCode environment which loads files from my local filesystem but runs them on a remote Python interpreter (via an SSH connection).

I am hoping I can run all the regular interactive Python REPL stuff using the remote kernel (e.g. show variables, etc). It seems like I should be able to somehow add a remote kernel and then select it via "Python: Select Interpreter", but I can't figure out how.

In the past I was able to configure such a setup in JupyterLab using the "remote_ikernel" package.

Is this possible in VSCode? I've found tons of documentation on the full remote setup, but haven't located information on this hybrid kind of set up.

question from:https://stackoverflow.com/questions/65929377/can-i-add-a-remote-python-interpreter-via-ssh-to-a-local-vscode-environment-i

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I found a related bug report which discusses mixing local and remote filesystems (not interpreters).

I suspect that the same difficulties it describes for filesystems may be similar reasons for why local files can not be easily fed into remote interpreters.

The full thread is here for reference:

https://github.com/microsoft/vscode-remote-release/issues/706

The specific quote:

Having a mixed workspace would require that a workspace extension can be active both locally and remotely. Currently an extension can only be active once, either locally or remotely. So this is currently not possible and we have no plans to support this. The recommendation is to have separate windows open for the local and remote workspace.

So it sound like this is a feature that is not currently supported.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...