question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

openpyxl >=2.4 throws use_iterators keyword argument unexpected

See original GitHub issue

Hi folks,

I am using petl 1.1.1 with openpyxl >=2.4. When executing

rows = petl.io.xlsx.fromxlsx('excel.xlsx', sheet='Sheet1')
print(rows)

I receive

Traceback (most recent call last):
  File "[...]\test.py", line 9, in <module>
    print(rows)
  File "[...]\lib\site-packages\petl\util\vis.py", line 169, in _table_str
    return str(lookstr(table))
  File "[...]\lib\site-packages\petl\util\vis.py", line 104, in __repr__
    table, overflow = _vis_overflow(self.table, self.limit)
  File "[...]\lib\site-packages\petl\util\vis.py", line 528, in _vis_overflow
    table = list(islice(table, 0, limit+2))
  File "[...]\lib\site-packages\petl\io\xlsx.py", line 51, in __iter__
    use_iterators=True, **self.kwargs)
TypeError: load_workbook() got an unexpected keyword argument 'use_iterators'

A quick search via the gogler reveals, that the use_iterators keyword argument was removed as of 2.4 of openpyxl.

Workaround: use openpyxl <2.4 (e.g. 2.3.2)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
GuiDoSignalcommented, Dec 5, 2017

Hey @alimanfoo any plans on promoting the fix to a new version into pip repository?

I am getting the same error but for a different cause: I am using docker and I am not able to put ‘git+’ on my pip requirements file, because then I will have to completely modify my image.

Since this is overdue since May, I hope that my message gives you motivation enough to push this fix to mainstream! 😉

Take care.

1reaction
GuiDoSignalcommented, Aug 28, 2017

I was able to find it on the internet! Thanks

pip install git+https://github.com/alimanfoo/petl.git

Read more comments on GitHub >

github_iconTop Results From Across the Web

openpyxl: Gives error on load_workbook() - Stack Overflow
TypeError: load_workbook() got an unexpected keyword argument 'use_iterators'. A pip freeze command shows that I was using openpyxl 2.3.5 ...
Read more >
Error opening xlsx, __init__() got an unexpected keyword ...
Created originally on Bitbucket by devdesu (Anna Coleman) Strange error on load_workbook(), win 10 x64, python 3.7, openpyxl==2.5.8:
Read more >
openpyxl.reader.excel module - Read the Docs
openpyxl.reader.excel module¶. Read an xlsx file into Python. class openpyxl.reader.excel. ExcelReader (fn, read_only=False, keep_vba=False, data_only=False ...
Read more >
Am I using the right version of openpyxl? - Google Groups
TypeError: __init__() got an unexpected keyword argument 'hashValue' ... Bitbucket has default, 2,3 and 2.4 branches. ReadTheDocs has 2.2.6 as the most ...
Read more >
iter_rows() got an unexpected keyword argument 'row_offset ...
To resolve this error, change version of openpyxl python -m pip install openpyxl==2.5 ERROR MESSAGE Traceback (most recent call last): File ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found