loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.42k stars 305 forks source link

Run Python Application in PyCharm Client via JetBrains Gateway #1093

Closed yangliuyu closed 1 month ago

yangliuyu commented 1 month ago

I use colima to setup a local k3s and create a workspace from python quickstart example https://github.com/microsoft/vscode-remote-try-python

image

Is your feature request related to a problem?
After setup, I can jump into the container shell from the Terminal

image

When I want to start the application, I need to setup a Run configuration

image

and when I setup a Python interpreter via SSH

image

got this error

image

The ~/.ssh/config has below content:

image

Which solution do you suggest?
The PyCharm client can recognize the SSH remote host and setup a remote Python Interpreter

Which alternative solutions exist?
N/A

Additional context
DevPod 0.5.8 | darwin | x86_64 JetBrains Gateway 2024.1.2

schlegel11 commented 1 month ago

Hello :smiley:

If I understand it right: You are already connected to your container via PyCharm gateway connection? Then why do you want to setup a remote interpreter via SSH because you are already connected via SSH to your container or better the whole PyCharm instance is a remote instance so you have to choose usually a "local interpreter" which means local in your container. Inside your container "vscode-remote-try-python.devpod" should be your localhost. Furthermore the ssh host config "vscode-remote-try-python.devpod" shouldn't be available inside your container which the error message "host not found" shows.

yangliuyu commented 1 month ago

Thanks for you suggestion. You are totally correct😃, after I setup a local interpreter, it all works.