The reason is that XLRD has recently been updated to version 2.0.1, which only supports.xls files. So pandas. Read_excel (‘ xxx.xlsx ‘) will report an error.

You can install the old XLRD and run it in CMD:

PIP uninstall XLRD PIP install XLRD ==1.2.0

You can also open.xlsx files with OpenPyxl instead of XLRD:

Df = pandas read_excel (‘ data. XLSX, engine = ‘openpyxl)