RandumbTune RandumbTune - 2 months ago 48
Python Question

openpyxl: Gives error on load_workbook()

The following code was executing fine, until I setup the development environment on a different computer.

workbook_obj = load_workbook(filename=xl_file, data_only=True, use_iterators=True)


I get the following error:

TypeError: load_workbook() got an unexpected keyword argument 'use_iterators'


A
pip freeze
command shows that I was using
openpyxl 2.3.5
previously when the code worked fine. My current version is
2.4.0
.

Is this a bug in
openpyxl
?

Answer

The use_iterators keyword was removed since 2.4.0. Use read_only=True instead.