xlsx files was removed from xlrd due to a potential security vulnerability.
Solution 1 — Upgrading Pandas To the Latest Version You can solve the xlrd. biffh. XLRDError: Excel xlsx file; not supported error by upgrading the Pandas version to the latest version.
Read an Excel file into a pandas DataFrame. Supports xls , xlsx , xlsm , xlsb , odf , ods and odt file extensions read from a local filesystem or URL. Supports an option to read a single sheet or a list of sheets. Any valid string path is acceptable.
As noted in the release email, linked to from the release tweet and noted in large orange warning that appears on the front page of the documentation, and less orange but still present in the readme on the repo and the release on pypi:
xlrd has explicitly removed support for anything other than xls files.
This is due to potential security vulnerabilities relating to the use of xlrd
version 1.2 or earlier for reading .xlsx
files.
In your case, the solution is to:
openpyxl
: https://openpyxl.readthedocs.io/en/stable/
pandas.read_excel('cat.xlsx', engine='openpyxl')
Edit: Currently, pandas >= 1.2 addresses this issue. (Release Notes)
The latest version of xlrd (2.0.1) only supports .xls files.
If you are prepared to risk potential security vulnerabilities, and risk incorrect parsing of certain files, this error can be solved by installing an older version of xlrd.
Use the command below in a shell or cmd prompt:
pip install xlrd==1.2.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With