使用python type6.xl3加载pivot表时出错

2024-04-24 10:54:34 发布

您现在位置:Python中文网/ 问答频道 /正文

基本上我是python新手,所以想在这里得到一些帮助。在

我有一个excel工作簿,里面有两张表,1。数据,2。数据透视表。在

我在使用此函数时出错,“openpyxl.load_工作簿('报告.xlsx')

这就是我得到的错误。在

 Traceback (most recent call last):
    File "excel_copy_by_header.py", line 15, in <module>
    wb2 = openpyxl.load_workbook('Report_0728.xlsx')
    File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\openpyxl-2.5.0a2-py3.6.egg\openpyxl\reader\excel.py", line 275, in load_workbook
    pivot = TableDefinition.from_tree(tree)
    File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\openpyxl-2.5.0a2-py3.6.egg\openpyxl\descriptors\serialisable.py", line 79, infrom_tree
    obj = desc.from_tree(el)
    File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\openpyxl-2.5.0a2-py3.6.egg\openpyxl\descriptors\sequence.py", line 86, in from_tree
    return [self.expected_type.from_tree(el) for el in node]
    File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\openpyxl-2.5.0a2-py3.6.egg\openpyxl\descriptors\sequence.py", line 86, in <listcomp>
    return [self.expected_type.from_tree(el) for el in node]
    File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\openpyxl-2.5.0a2-py3.6.egg\openpyxl\descriptors\serialisable.py", line 99, infrom_tree
    return cls(**attrib)
    TypeError: __init__() got an unexpected keyword argument 'extLst'

根据我最初的研究,我无法确定Python3.6是否支持带有透视表的工作簿。在

任何形式的帮助都是非常感谢的!!在


Tags: inpytreelibpackageslocallinesite