import xlrd # import openpyxl data = xlrd.open_workbook("data1.xlsx") print(data.sheet_loaded(0))
"E:\Embedded programming\Python\20210201Monday\venv\Scripts\python.exe" "E:/Embedded programming/Python/20210201Monday/hello.py"
Traceback (most recent call last):
File "E:/Embedded programming/Python/20210201Monday/hello.py", line 4, in <module>
data = xlrd.open_workbook("data1.xlsx")
File "E:\Embedded programming\Python\20210201Monday\venv\lib\site-packages\xlrd\__init__.py", line 170, in open_workbook
raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
xlrd.biffh.XLRDError: Excel xlsx file; not supported
我刚才可以了,把文件格式保存了.xls就可以了;我之前的另一个步骤是把
pip uninstall xlrd
pip install xlrd==1.2.0
进行卸载和安装
可以了吗?不行使用上面的在cmd中运行
pip3 install pyexcel-xls
还是不行
可以使用
pip3 install pyexcel-xls