You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jupyter中pd.read_excel调用openpyxl触发RecursionError原因排查

Jupyter Notebook新标签页导入openpyxl或使用pd.read_excel触发RecursionError,旧标签页可正常运行

之前运行正常的代码:

df_excel = pd.read_excel(r'D:\Jupyter\XML_Tag_Rules.xlsx', index_col='Tag', engine='openpyxl')

近期在Jupyter的新标签页执行时会触发RecursionError,哪怕只单独执行import openpyxl也会报同样的递归深度超限错误,但旧标签页里所有操作依然正常。

相关报错栈如下:
执行pd.read_excel时的错误:

RecursionError                            Traceback (most recent call last)
Cell In[5], line 6
      4 root = ET.parse(file_path).getroot()      
      5 sys.setrecursionlimit(100)
----> 6 tagRules = pd.read_excel(r'D:\Jupyter\Music_Partitions\MusicXML_Tag_Rules.xlsx', index_col='Tag', engine='openpyxl')

[省略中间报错栈]
RecursionError: maximum recursion depth exceeded

单独导入openpyxl时的错误:

import openpyxl
print(openpyxl.__version__)

RecursionError                            Traceback (most recent call last)
Cell In[7], line 4
      1 import pandas as pd
      2 print(pd.__version__)
----> 4 import openpyxl
      5 print(openpyxl.__version__)

[省略中间报错栈]
RecursionError: maximum recursion depth exceeded

有没有人遇到过同样的情况?

内容的提问来源于stack exchange,提问作者EMHmark7

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 18:34:52