VSCode debugger attach to local process

Jun Park picture Jun Park · Apr 13, 2018 · Viewed 10.9k times · Source

One of the great features of PyCharm is that it allows its debugger to attach to python processes running locally (and outside of the IDE).

As I am trying to move to VSCode to work in Python, I am struggling to configure launch.json to simulate PyCharm's attach to local process feature.

{
    "name": "Python: Attach",
    "type": "python",
    "request": "attach",
    "localRoot": "${workspaceFolder}",
    "remoteRoot": "${workspaceFolder}",
    "port": 8001,
    "secret": "my_secret",
    "host": "localhost"
},

This configuration is created by default when I select Python: attach option for debugger but I am convinced this is for remote debugging (with port and all), and most Google search results just talk about remote debugging for Python with VSCode.

Anyone had success in attaching a local debugger or two to multiple python processes running locally?

Answer

Brett Cannon picture Brett Cannon · Apr 17, 2018

Local attach is currently not supported but is being worked on.