我想用PyExcel打开一个简单的excel文件,下面是我的代码
>>import os
>>import pyexcel as pe
>>print('Directory Path=', os.getcwd())
Directory Path= C:\Users\Contacts\My experimentation
>>sheet = pe.get_sheet(file_name="C:/Users/Contacts/My experimentation/Mylist.xlsx")

这是我的Excel文件的名称。这就是我得到的错误
Directory Path= C:\Users\Contacts\My experimentation
Traceback (most recent call last):
File "C:/Users/Contacts/My experimentation/abc.py", line 5, in <module>
sheet = pe.get_sheet(file_name="C:/Users/Contacts/My experimentation/Mylist.xlsx")
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\pyexcel\core.py", line 36, in get_sheet
named_content = sources.get_sheet_stream(**keywords)
File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\pyexcel\internal\core.py", line 20, in get_sheet_stream
sheets = a_source.get_data()有人能告诉我我哪里做错了吗?谢谢!
发布于 2017-07-11 20:56:14
解决方案可能会安装此插件以支持xls文件格式:
pip install pyexcel-xls对于xlsx,然后是pip install pyexcel-xlsx。只需转到您的脚本文件夹,打开命令窗口并记下命令即可。希望这能有所帮助。
https://stackoverflow.com/questions/45035119
复制相似问题