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

相关推荐
Digitally7 小时前
解决“Move to iOS 卡在准备中”的 9 种有效方法
macos·ios·cocoa
影魅周影10 小时前
解决mac端pycharm执行allure命令报错:returned non-zero exit status 127
ide·macos·pycharm
2501_9275410913 小时前
CameraBag Mac英文 照片视频滤镜编辑工具
macos
uiop_uiop_uiop17 小时前
iOS arm64e hook MGCopyAnswer got Crash or Only Partial results got hooked
macos·ios·cocoa
私人珍藏库20 小时前
[Mac] Unclutter 2.2.15 Mac上的文件暂存 智能剪贴板历史记录管理器工具
macos
哈茶真的c20 小时前
【Mac】开发环境使用/维护
macos
醇氧1 天前
mac 安装 LibreOffice
macos
马拉萨的春天1 天前
iOS中如果一个大图500M直接加载显示会崩溃,那么如何设置加载显示呢?
macos·ios·cocoa
AiXed1 天前
PC微信WDA算法
前端·javascript·macos
刘晓倩1 天前
Docker Desktop(Windows/Mac)零外网部署 Dify 极简指南
macos·docker·容器