Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code does not attach debugger to multi processes in python using pool map

Hi I am trying to debug multi processes in python. This below is a portion of where I run multi-processes using Pool

pool = Pool(num_half_logical_cpus)
pool_result_dict = pool.starmap(process_batches, lstListSets)

However, I can't hit any breakpoints. Can anyone guide me to hit those breakpoints I set up?

Thanks!

like image 658
Seong Kim Avatar asked Mar 21 '26 18:03

Seong Kim


1 Answers

Add this option to launch.json will let you debug multiple processes.

"subProcess": true,

Then it will hit the breakpoint then you are able to select which process you want to step through (F10). There will be a list of processes at the lower-left sub-window.

like image 86
Seong Kim Avatar answered Mar 23 '26 06:03

Seong Kim