问题描述:
使用Python读取Excel文件时,当删除Excel中的某个tab或者更改数据后,导致读取到该tab的时候失败,报错:
Value must be either numerical or a string containing a wildcard
思考:文件本身无问题,可以打开,考虑openpyxl包版本的问题。于是查阅其他技术博客,验证了猜想,通过安装其他版本的openpyxl解决。
解决方案:
卸载已安装的openpyxl包,通过命令 pip uninstall openpyxl
安装3.0.10版本,通过命令 pip install openpyxl==3.0.10
安装后再次读取该修改后的Excel文件,不在报错。