尝试在 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 似乎具有命名范围功能,所以我不确定是什么原因造成的。任何帮助表示赞赏。