如何解决“在检查\u excel\u格式中断言内容\u或\u路径不是无断言”错误?

2024-06-26 01:56:40 发布

您现在位置:Python中文网/ 问答频道 /正文

downloaded = drive.CreateFile({'id': file_id})

email_list = pd.read_excel(downloaded.GetContentFile('test.xlsx'))


Traceback (most recent call last):
  File "mail.py", line 34, in <module>
    email_list = pd.read_excel(downloaded.GetContentFile('test.xlsx'))
  File "/home/vyshnav/test/python/emai_automation/venv/lib/python3.8/site-packages/pandas/util/_decorators.py", line 299, in wrapper
    return func(*args, **kwargs)
  File "/home/vyshnav/test/python/emai_automation/venv/lib/python3.8/site-packages/pandas/io/excel/_base.py", line 336, in read_excel
    io = ExcelFile(io, storage_options=storage_options, engine=engine)
  File "/home/vyshnav/test/python/emai_automation/venv/lib/python3.8/site-packages/pandas/io/excel/_base.py", line 1071, in __init__
    ext = inspect_excel_format(
  File "/home/vyshnav/test/python/emai_automation/venv/lib/python3.8/site-packages/pandas/io/excel/_base.py", line 947, in inspect_excel_format
    assert content_or_path is not None
AssertionError

Tags: inpyiotesthomevenvlibpackages