解决pandas读取excel文件出错

Traceback (most recent call last):
  File "c:/Users/Admin/Desktop/读取文件.py", line 4, in <module>
    data=pd.read_excel(filepath,'sheet1')
  File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\pandas\util\_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\pandas\io\excel\_base.py", line 364, in read_excel
    io = ExcelFile(io, storage_options=storage_options, engine=engine)
  File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\pandas\io\excel\_base.py", line 1192, in __init__
    content_or_path=path_or_buffer, storage_options=storage_options
  File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\pandas\io\excel\_base.py", line 1071, in inspect_excel_format
    content_or_path, "rb", storage_options=storage_options, is_text=False
  File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\pandas\io\common.py", line 710, in get_handle
    handle = open(handle, ioargs.mode)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Admin\\Desktop\\字典20191018.xlsx'

读取文件的文件名必须英文,中文文件名则会出现上述问题

 

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值