Is it possible to remotely debug IDAPyhton scripts using VSCode and ptvsd? I found a few tutorials on the net, but no one is working. In the past, using the same protocol I was able to connect to Maya from VSCode and to remotely debug Pymel scripts. So, from IDA python console I entered:

ptvsd.enable_attach(address=('localhost', 5678), redirect_output=True)

and eventually:


A Python MsgBox appears telling a script is running... Now in VSCode I started the script to be debugged using the standard json configuration file for attaching to a remote debugger, but the connection is always refused. I tried to change the port (3528, 3000), the address ( and to remove the redirect_output flag. No matter what, I wasn't able to connect. I tried also:


But again, no luck.

As a second question, is there a way to make the import statement recognize IDAPython modules (idaapi, idc, idc_bytes and so on) or to use autocompletion? I know IDAPython is bundled with IDA and not installed in site-packages, but I wonder if is there a solution (not to execute the script outside of IDA, but to have the modules and keywords recognized).

  • Worth noting break_into_debugger only works if the debugger is already attached. First I took it to do what wait_for_attach is doing.
    – Trass3r
    Oct 6 '20 at 13:50

Something this should work for ptvsd:

            "name": "Python: Remote Attach",
            "type": "python",
            "request": "attach",
            "debugServer": 5678,
            "showReturnValue": true,
            "internalConsoleOptions": "openOnSessionStart",
            "redirectOutput": true,

You may need to insert an explicit breakpoint() in the code.

For IntelliSense in VSCode there's PYTHONPATH or

    "python.autoComplete.extraPaths": [
    "python.analysis.extraPaths": [

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.