Member-only story
Pandas read_excel removed support for xlsx files
How you can solve the XLRDError since support for xlsx filetypes has been removed
A lot of people encounter the “XLRDError: Excel xlsx file; not supported” when using their read_excel function from the pandas package.
Pandas uses the xlrd as their default engine for reading excel files. However, xlrd has removed support for anything other than xls files in their latest release.
This causes you to receive the error that the xlsx filetype is no longer supported when calling the read_excel function on a xlsx excel using pandas.
To solve this, do the following:
- Install openpyxl: This is another excel package that still supports the xlsx format
- Set the engine to “openpyxl” instead of the default “xlrd”
# Install openyxl
pip install openpyxl# set engine parameter to "openpyxl"pd.read_excel(path, engine = 'openpyxl')
Happy programming!
Cheers,
Ewoud