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

相关推荐
pe7er3 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
harmful_sheep5 天前
mac生效的终端查看
macos
iOS门童6 天前
macOS 应用"已损坏"无法打开?一文搞懂 Gatekeeper 与解决方案
macos
NPE~6 天前
[工具分享]Maccy —— 优雅的 macOS 剪贴板历史管理工具
macos·教程·工具·实用工具
差不多程序员6 天前
Mac安装OpenClaw-cn保姆级教程
macos
dzl843946 天前
mac 安装python
开发语言·python·macos
Bruce_Liuxiaowei6 天前
在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程
macos·docker·容器·openclaw
阿捏利6 天前
详解Mach-O(十五)Mach-O __DATA_CONST
macos·ios·c/c++·mach-o
ShikiSuen6 天前
macOS 的 CpLk 中英切换卡顿的元凶在 InputMethodKit 本身
macos
xiayutian_c6 天前
如虎添翼-MacOS
macos