You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode Python多进程调试:如何开启自动附加子进程选项?

How to Enable PyDev's "Attach to Subprocess Automatically" in VSCode (pythonExperimental Debugger)

Got it, let's get those subprocess breakpoints working for you. Since you're using the pythonExperimental debugger in VSCode with Python 3.6, here are two straightforward ways to enable the auto-attach option mentioned in the PyDev prompt:

Method 1: Use VSCode's Settings UI

  • Open VSCode's settings panel: Press Ctrl+, (Windows/Linux) or Cmd+, (Mac), or click the gear icon in the bottom-left corner and select Settings.
  • In the search bar at the top, type Python > Debugger: Attach To Subprocess.
  • Check the checkbox next to this option—it’s labeled something like "Automatically attach the debugger to subprocesses launched by a debugged process".
  • Close the settings panel, and restart your debug session. Your subprocesses should now be automatically attached, and breakpoints will work in them.

Method 2: Edit the launch.json Debug Configuration

  • Open your launch.json file: Go to the Run and Debug panel (Ctrl+Shift+D / Cmd+Shift+D), click the gear icon in the top-right corner to open the debug configuration file.
  • Find the configuration block where "type": "pythonExperimental" is set.
  • Add the following line inside that configuration object:
    "autoAttachChildProcesses": true
    
  • Save the launch.json file, then restart your debug session. This will force the debugger to automatically attach to any subprocesses your main program launches.

After setting this up, the next time you run your program, you won’t see that PyDev warning anymore, and your breakpoints will work as expected in the child processes.

内容的提问来源于stack exchange,提问作者user3667122

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:44:26