使用Python读取Excel时报错zipfile.BadZipFile: File is not a zip file。这个错误通常发生在pd.read_excel
尝试打开一个非zip格式的Excel文件时。试试将engine='openpyxl'
更改为engine='xlrd'
。即可正常运行。前提是你有xlrd库,pip一下即可。
pip install xlrd
使用Python读取Excel时报错zipfile.BadZipFile: File is not a zip file。这个错误通常发生在pd.read_excel
尝试打开一个非zip格式的Excel文件时。试试将engine='openpyxl'
更改为engine='xlrd'
。即可正常运行。前提是你有xlrd库,pip一下即可。
pip install xlrd