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 实际上只在一个线程中运行,调试器能够正常工作。

相关推荐
2601_9657984741 分钟前
Launch Your Wellness App Fast: The Truth About Meditation Source Code
前端·macos·ios·objective-c·cocoa
2501_915909062 天前
全面解析iOS应用上架到App Store的完整流程与关键注意事项
android·macos·ios·小程序·uni-app·cocoa·iphone
2501_915918412 天前
免 Xcode 开发 iOS,工具链替代方案与编译、签名、安装
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
Architect_Lee2 天前
mac安装多个tomcat
macos
ty_xiumud2 天前
以太网 MAC 详解:帧格式、位序、FCS 与收发流程
开发语言·macos·php
营养充电站2 天前
C++23 新特性在 CLion 中的实战体验
macos·docker·jupyter·正则表达式
liliangcsdn2 天前
如何为m1 mac安装arm版node
macos
2501_916008893 天前
移动安全之 APP 加固,保障移动应用安全的重要手段
安全·macos·ios·小程序·uni-app·iphone·xcode
艾莉丝努力练剑3 天前
Mac 远程桌面体验:6 个工具的 macOS 适配情况整理
linux·运维·服务器·macos·面试