簡體   English   中英

打開具有命名范圍的Excel文件時出現xlrd錯誤

[英]xlrd error when opening Excel files with named ranges

嘗試在Python 3.2.4上使用xlrd 0.9.1打開工作簿時收到以下錯誤消息。 我進行了測試,看是什么原因引起的,並且已經對具有命名范圍的電子表格進行了故障排除。

Traceback (most recent call last):
  File "C:\Users\mandroid\Desktop\xltest.py", line 5, in <module>
    book = open_workbook(pth)
  File "C:\Python32\lib\site-packages\xlrd\__init__.py", line 416, in open_workbook
    ragged_rows=ragged_rows,
  File "C:\Python32\lib\site-packages\xlrd\xlsx.py", line 725, in open_workbook_2007_xml
    x12book.process_stream(zflo, 'Workbook')
  File "C:\Python32\lib\site-packages\xlrd\xlsx.py", line 251, in process_stream
    meth(self, elem)
  File "C:\Python32\lib\site-packages\xlrd\xlsx.py", line 346, in do_defined_names
    self.do_defined_name(child)
  File "C:\Python32\lib\site-packages\xlrd\xlsx.py", line 335, in do_defined_name
    nobj.formula_text = cooked_text(self, elem)
  File "C:\Python32\lib\site-packages\xlrd\xlsx.py", line 130, in cooked_text
    return unicode(unescape(t))
TypeError: <lambda>() takes exactly 2 arguments (1 given)

從我閱讀的內容來看,xlrd似乎已經命名了range功能,所以我不確定是什么原因引起的。 任何幫助表示贊賞。

這是xlrd 0.9.1中的錯誤: https : //github.com/python-excel/xlrd/issues/47

您可以嘗試0.9.0,等待0.9.2或應用John Machin在報告中建議的修復方法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM