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

相关推荐
Lancker3 小时前
没有 Mac 也能上架 iOS:GitHub Actions 全自动构建 + 签名 + TestFlight 送审实录
macos·ios·github
fei_sun1 天前
RIB、FIB、MAC 、ARP 表
服务器·网络·macos
Highcharts.js1 天前
如何在macOS桌面应用集成Highcharts
macos·highcharts·前端可视化·交互图表
zaemyn20201 天前
macOS 上 AccessClient 无法唤起?排查 Python 架构与 Windows App 识别问题
windows·python·macos·远程桌面·accessclient
应用市场2 天前
把旧 Pixel 变成相册备份中转站(上):Mac 到安卓的照片传输工具设计——流式上传、sha256 校验、adb forward 与 Bonjour
android·macos·adb·kotlin·swift
Peter(阿斯拉)3 天前
[macOS Tahoe 26]_[使用SmartSVN访问库路径报错的问题]
macos·svn·tahoe·smartsvn·macos26
andyweike3 天前
iOS语法原理
macos·objective-c·cocoa
传奇开心果编程4 天前
【SwiftUI提高练中学】第8课 网络层架构:拦截器、重试、缓存与离线优先
学习·macos·ui·ios·swiftui
xUxIAOrUIII4 天前
日常笔记-1005-1
linux·笔记·python·macos
传奇开心果编程4 天前
【Compose Multiplatform 跨端开发学与练】第9课 测试与调试
android·学习·macos·ios·kotlin·web·composer