I have a problem with the error 'ReadOnlyWorksheet' object has no attribute 'defined_names' when loading a workbook.
Stack trace:
File "/opt/my_project/utils/excel.py", line 55, in load_workbook
return openpyxl.load_workbook(
File "/usr/local/lib/python3.10/site-packages/openpyxl/reader/excel.py", line 346, in load_workbook
reader.read()
File "/usr/local/lib/python3.10/site-packages/openpyxl/reader/excel.py", line 303, in read
self.parser.assign_names()
File "/usr/local/lib/python3.10/site-packages/openpyxl/reader/workbook.py", line 109, in assign_names
sheet.defined_names[name] = defn
I am able to fix this by reverting from version 3.1.1 to 3.1.0 of openpyxl.
However, I'm unable to replicate this problem, so I'm guessing there's some obscure difference in my project's code that isn't captured in the simple example below. The code above is from a Linux container for a project I'm working on, while the snippets below are using Python on Windows 10.
I have a problem with the error
'ReadOnlyWorksheet' object has no attribute 'defined_names'
when loading a workbook.Stack trace:
I am able to fix this by reverting from version 3.1.1 to 3.1.0 of openpyxl.
However, I'm unable to replicate this problem, so I'm guessing there's some obscure difference in my project's code that isn't captured in the simple example below. The code above is from a Linux container for a project I'm working on, while the snippets below are using Python on Windows 10.
Openpyxl version 3.1.0
Openpyxl version 3.1.1