pycharm的debugger失效

all_df = Parallel(n_jobs=n_jobs)(

delayed(read_factor)(base_file, factor_dict, factor_period, hold_period, all_factor_list)

for base_file in base_file_path

)

我的pycharm在这句话之前可以debug,这句话之后无法停到断点

这个问题可能与 Parallel 和 delayed 相关。这些工具属于 joblib 库,用于并行化计算。并行计算可能会导致调试器失去对子线程的控制,因此无法在 Parallel 中设置断点。

解决方案:

禁用并行化:暂时关闭并行处理,直接运行代码来进行调试。可以通过将 n_jobs=1 来实现:

复制代码
all_df = Parallel(n_jobs=1)(
    delayed(read_factor)(base_file, factor_dict, factor_period, hold_period, all_factor_list)
    for base_file in base_file_path
)

这样,Parallel 实际上只在一个线程中运行,调试器能够正常工作。

相关推荐
传奇开心果编程18 小时前
【SwiftUI入门练中学】第7课 动画与手势:让界面更灵动
学习·macos·ui·ios·swiftui·swift
the3clipse1 天前
MacOS、Linux 与 Windows 视频编解码对比:AV1、HEVC、ProRes 与硬件加速优劣势
linux·windows·macos·hevc·av1·视频解码·硬件解码
传奇开心果编程2 天前
【SwiftUI娓娓道来】第3课:让界面活起来——交互与动画指南
学习·macos·ui·ios·swiftui·swift
朋友圈自动点赞工具2 天前
Gmail 委托邮箱在手机上关不掉
macos·智能手机·cocoa·硬件评测
小黄人软件2 天前
AndroidStudio老项目 macOS运行BlueTooth蓝牙串口助手(Android+Studio源码).rar
android·macos
她说..2 天前
IntelliJ IDEA 快捷键速查表(Mac 版)
java·macos·intellij-idea
for_ever_love__2 天前
iOS: CABasicAnimation动画
macos·ios·cocoa
ITKEY_2 天前
Mac mini彻底禁止自动睡眠
macos
k4m7v2pz3 天前
用中文编程语言写游戏:玄铁语言生命游戏的 macOS 适配实录
游戏·macos·玄铁·生命游戏·中文编程语言·玄铁中文编程
大熊猫侯佩3 天前
macOS27 上可变界面尺寸 iOS App 揭秘
macos·ios·swiftui