简体   繁体   English

Python openpyxl TypeError:__init __()获得了意外的关键字参数'pivotButton'

[英]Python openpyxl TypeError: __init__() got an unexpected keyword argument 'pivotButton'

I get an error when trying to open the xlsx file (Excell 2010) with Python 3.4.3 & openpyxl 2.2.0. 尝试使用Python 3.4.3和openpyxl 2.2.0打开xlsx文件(Excell 2010)时出现错误。 Is there any workaround to tesolve this issue ot this is a bug? 是否有解决此问题的解决方法,这是一个错误?

import openpyxl
wb = openpyxl.load_workbook(filename = 'C:/TEMP/tfile.xlsx')


Traceback (most recent call last):
  File "C:\TEMP\py\pxl.py", line 3, in <module>
    wb = openpyxl.load_workbook(filename = 'C:/TEMP/tfile.xlsx')
  File "C:\Python34\lib\site-packages\openpyxl-2.2.0-py3.4.egg\openpyxl\reader\excel.py", line 149, in load_workbook
    _load_workbook(wb, archive, filename, read_only, keep_vba)
  File "C:\Python34\lib\site-packages\openpyxl-2.2.0-py3.4.egg\openpyxl\reader\excel.py", line 237, in _load_workbook
    keep_vba=keep_vba)
  File "C:\Python34\lib\site-packages\openpyxl-2.2.0-py3.4.egg\openpyxl\reader\worksheet.py", line 324, in read_worksheet
    fast_parse(ws, xml_source, shared_strings, style_table, color_index)
  File "C:\Python34\lib\site-packages\openpyxl-2.2.0-py3.4.egg\openpyxl\reader\worksheet.py", line 312, in fast_parse
    parser.parse()
  File "C:\Python34\lib\site-packages\openpyxl-2.2.0-py3.4.egg\openpyxl\reader\worksheet.py", line 93, in parse
    dispatcher[tag_name](element)
  File "C:\Python34\lib\site-packages\openpyxl-2.2.0-py3.4.egg\openpyxl\reader\worksheet.py", line 189, in parse_row_dimensions
    self.parse_cell(cell)
  File "C:\Python34\lib\site-packages\openpyxl-2.2.0-py3.4.egg\openpyxl\reader\worksheet.py", line 134, in parse_cell
    cell = Cell(self.ws, column, row, **style)
TypeError: __init__() got an unexpected keyword argument 'pivotButton'

Regards, Sergey 问候,谢尔盖

I just ran into the same issue. 我只是遇到了同样的问题。 This is a bug in openpyxl that was fixed on March 24 2015, however the fix as of now has not been pushed to a release. 这是openpyxl中的错误,已于2015年3月24日修复,但是截至目前该修复尚未推送到版本中。

You can work around the issue by downgrading to openpyxl 2.1.5: 您可以通过降级到openpyxl 2.1.5来解决此问题:

pip install openpyxl==2.1.5

See the Bug Report for details. 有关详细信息,请参见错误报告 You can also remove the pivot table from your excel file to work around the issue. 您也可以从excel文件中删除数据透视表,以解决此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Telethon Python TypeError:__init__() 得到了一个意外的关键字参数“hash” - Telethon Python TypeError: __init__() got an unexpected keyword argument 'hash' Python Flask - TypeError: __init__() 得到了一个意外的关键字参数“lable” - Python Flask - TypeError: __init__() got an unexpected keyword argument 'lable' TypeError at &#39;&#39; __init__() 得到一个意外的关键字参数 &#39;&#39; - TypeError at '' __init__() got an unexpected keyword argument '' Python 3.5:TypeError:__ init __()得到了一个意外的关键字参数'nosigint' - Python 3.5 : TypeError: __init__() got an unexpected keyword argument 'nosigint' python请求:TypeError:__ init __()得到一个意外的关键字参数&#39;proxies&#39; - python requests: TypeError: __init__() got an unexpected keyword argument 'proxies' pyexcel / openpyxl __init __()得到了意外的关键字参数错误 - pyexcel / openpyxl __init__() got an unexpected keyword argument ERROR 为什么我得到了一个 TypeError: __init__() 在 python sklearn 中得到了一个意外的关键字参数“outer_cv”? - Why I got an TypeError: __init__() got an unexpected keyword argument 'outer_cv' in python sklearn? 类型错误:__init__() 得到了一个意外的关键字参数“宽度” - TypeError: __init__() got an unexpected keyword argument 'width' TypeError:__init __()获得了意外的关键字参数&#39;log_path&#39; - TypeError: __init__() got an unexpected keyword argument 'log_path' 类型错误:__init__() 得到了一个意外的关键字参数“轴” - TypeError: __init__() got an unexpected keyword argument 'axis'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM