I\'m trying to open both an xlsx file and an xlsm file both give me the same error
badzipfile: file is not a zip file
here is wh
If you call openpyxl.load_workbook
with file-like object, be sure to open it in binary mode.
The xlsx file may have password and you are not granted to access. Delete the password and you can use openpyxl.load_workbook() to access it.
I have been facing this error for a while and so i just uninstalled openpyxl and reinstall version 2.6.3 and it worked well. This might help you too, no need to change anything just run these commands using pip
pip uninstall openpyxl
pip install openpyxl==2.6.3
Hope it helps you.
I had the same problem. It is because the file I was trying to open in Python was already running. You need to check if the file you are trying to open in Python is not running in tasks.
The same problem occurred to me, and then I noticed the following:
When I created the .xlsx file from file manager, by creating new document with .xlsx format, I had the same error. But when I created the file with some spreadsheet software (libreoffice-calc) in my case, it just worked fine. I hope this may help.
This also happened to me when I pointed openpyxl to an alias of the file instead of the original file.