Python FAQ – error using openpyxl module: zipfile.BadZipFile : File is not a zip file

Background

Under the pychar project, there is a data.xlsx , which is mainly used to store the data of interface test cases

To read through openpyxl Library data.xlsx Methods: openpyxl.load_ workbook(path)

Then the error is reported, as shown in the figure below

Cause of the problem

Xlsx can’t be opened normally. You can try to double-click in pychar data.xlsx , you will find that the xlsx file cannot be opened normally

Solutions

This problem can only be solved by re creating a new xlsx file and then covering the damaged file

This article shares cnblog – a pineapple, a Yao.
In case of infringement, please contact [email protected] Delete.
This article participates in the “OSC source creation program”. You are welcome to join and share.

Similar Posts: