python 常见错误集锦

1、Pandas cannot open an Excel (.xlsx) file

错误显示:Excel xlsx file; not supported

原因:新版本的xlrd只支持xls文件

解决办法:

①使用旧版本xlrd

pip3 install xlrd==1.2.0

②使用openpyxl代替xlrd

pd.read_excel('xxxx.xlsx', engine='openpyxl')

原文地址:https://www.cnblogs.com/SAN-W/p/14944929.html