python-fitparse icon indicating copy to clipboard operation
python-fitparse copied to clipboard

xlrd.biffh.XLRDError: Excel xlsx file; not supported

Open MeisterP opened this issue 4 years ago • 2 comments

$ python3 scripts/generate_profile.py FitSDKRelease_21.53.00.zip fitparse/profile.py
Traceback (most recent call last):
  File "/devel/git/python-fitparse/scripts/generate_profile.py", line 626, in <module>
    main(xls, profile)
  File "/devel/git/python-fitparse/scripts/generate_profile.py", line 558, in main
    types_rows, messages_rows = parse_spreadsheet(xls_file, 'Types', 'Messages')
  File "/devel/git/python-fitparse/scripts/generate_profile.py", line 339, in parse_spreadsheet
    workbook = xlrd.open_workbook(file_contents=xls_file.read())
  File "/usr/lib/python3.9/site-packages/xlrd/__init__.py", line 170, in open_workbook
    raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
xlrd.biffh.XLRDError: Excel xlsx file; not supported

from https://github.com/python-excel/xlrd#xlrd

Warning

This library will no longer read anything other than .xls files. For alternatives that read newer file formats, please see http://www.python-excel.org/.

MeisterP avatar May 15 '21 10:05 MeisterP

You'll need to use openpyxl or a library that can read xlsx files. PR welcome!

dtcooper avatar May 20 '21 08:05 dtcooper

@dtcooper see here: https://github.com/dtcooper/python-fitparse/pull/134

fundthmcalculus avatar Nov 01 '21 13:11 fundthmcalculus