提问人:Vijay Bokade 提问时间:11/16/2023 最后编辑:Vijay Bokade 更新时间:11/16/2023 访问量:63
使用 openpyxl 加载工作簿时出现值错误
Value Error while Loading workbook using openpyxl
问:
当我尝试使用 openpyxl 加载工作簿时,
我收到这种类型的错误
File "d:\.cit_local_prod\New folder_changes\excelToJson\exceltojson.py", line 90, in parse_excel_to_json
workbook = px.load_workbook(filename_with_path,data_only=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\reader\excel.py", line 328, in load_workbook
reader.read()
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\reader\excel.py", line 291, in read
self.read_worksheets()
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\reader\excel.py", line 235, in read_worksheets
ws_parser.bind_all()
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\worksheet\_reader.py", line 450, in bind_all
self.bind_cells()
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\worksheet\_reader.py", line 351, in bind_cells
for idx, row in self.parser.parse():
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\worksheet\_reader.py", line 151, in parse
obj = prop[1].from_tree(element)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\descriptors\serialisable.py", line 103, in from_tree
return cls(**attrib)
^^^^^^^^^^^^^
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\worksheet\filters.py", line 327, in __init__
self.ref = ref
^^^^^^^^
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\descriptors\excel.py", line 104, in __set__
super(CellRange, self).__set__(instance, value)
File "d:\.cit_local_prod\New folder_changes\excelToJson\openpyxl\descriptors\base.py", line 252, in __set__
raise ValueError('Value does not match pattern {0}'.format(self.pattern))
ValueError: Value does not match pattern ^[$]?([A-Za-z]{1,3})[$]?(\d+)(:[$]?([A-Za-z]{1,3})[$]?(\d+)?)?$|^[A-Za-z]{1,3}:[A-Za-z]{1,3}$
file failed
我想找到这个错误的来源。谁能帮我?
当我重命名文件并用新名称保存它时,它会完美加载。
但是,我想确定错误的来源。
有没有办法找到来源
答: 暂无答案
评论