Skip to content
Advertisement

How to debug remote python code from local windows vs code

I want to debug python code (on remote linux) in local windows with VS code.

I did as follows:

  1. In windows VS code, I can open remote linux python project using SSH.
  2. Installed python debug tool ptvsd both in windows and remote linux.
  3. Add code below in python project:
JavaScript
  1. Project launch.json:
JavaScript
  1. Start run in remote linux.
  2. Add break points in vs code, and run -> start debugging, then hit an issue as follows. I am confused that test.py is not in dir /c4_working/test.py but in dir /c4_working/python_code/test.py. And this file actually exists. So I am not sure why it would want to find the file in dir /c4_working/test.py? How would I fix it?

error

Advertisement

Answer

Fixed this issue after creating a new launch.json file for this dir /c4_working/python_code.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement