How do I debug a python application with Okteto and VSCode

Hi @ramiro,

I am trying to use Okteto for remote debugging of Python applications on K8S, with the VSCode as IDE.

I have “okteto build --deploy” and “okteto up” running

But it seems like I am missing something, because when I start debugging, I get a new local WSL terminal opened in VS Code, and it tries to run my application locally, which I want to be done remotely, if I understand correctly the flow.
Could you please suggest a clue?
Thank you!

Hey @russkey007!

That typically happens when your debug command in VSCode is configured to start a process rather than attaching to the existing one.

This document explains the principles of remote debugging with python. The sample uses PyCharm.

This recent thread contains an example on how to use VSCode to debug a FastAPI python API, I think this might help you see what your configuration is missing.

Hope it helps!

1 Like