KeyError:u'xl / worksheets / Sheet1.xml'在尝试使用python xlrd打开xlsx文件时给出

时间:2015-11-27 04:46:03

标签: python python-2.7 xlrd

我无法使用python xlrd库处理某些文件。 这是我的代码,

>>> from xlrd import open_workbook, XLRDError
>>> try:
...     book = open_workbook('17112015Rpt1000000178_Report.xlsx')
... except XLRDError as e:
...     print e
... 

我收到以下错误。

     Traceback (most recent call last):
          File "<stdin>", line 2, in <module>
          File "/usr/local/lib/python2.7/dist-packages/xlrd/__init__.py", line 422, in open_workbook
            ragged_rows=ragged_rows,
          File "/usr/local/lib/python2.7/dist-packages/xlrd/xlsx.py", line 790, in open_workbook_2007_xml
            zflo = zf.open(component_names[fname])
KeyError: u'xl/worksheets/Sheet1.xml' 

如何解决此问题?

0 个答案:

没有答案