问答详情
源自:2-2 Pandas读取和保存数据的方法(二)

读取不出表格

C:\Users\25307\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\25307\PycharmProjects\pythonProject\shujuduqu.py 

Traceback (most recent call last):

  File "C:\Users\25307\PycharmProjects\pythonProject\shujuduqu.py", line 2, in <module>

    df=pd.read_excel('三亚理工职业学院2022—2023学年第二学期学院专业课期末考试安排0615.xlsx')

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\25307\PycharmProjects\pythonProject\venv\Lib\site-packages\pandas\io\excel\_base.py", line 478, in read_excel

    io = ExcelFile(io, storage_options=storage_options, engine=engine)

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\25307\PycharmProjects\pythonProject\venv\Lib\site-packages\pandas\io\excel\_base.py", line 1496, in __init__

    ext = inspect_excel_format(

          ^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\25307\PycharmProjects\pythonProject\venv\Lib\site-packages\pandas\io\excel\_base.py", line 1371, in inspect_excel_format

    with get_handle(

         ^^^^^^^^^^^

  File "C:\Users\25307\PycharmProjects\pythonProject\venv\Lib\site-packages\pandas\io\common.py", line 868, in get_handle

    handle = open(handle, ioargs.mode)

             ^^^^^^^^^^^^^^^^^^^^^^^^^

FileNotFoundError: [Errno 2] No such file or directory: '三亚理工职业学院2022—2023学年第二学期学院专业课期末考试安排0615.xlsx'


进程已结束,退出代码1


提问者:慕神1337058 2023-08-08 01:24

个回答

  • 慕圣8297738
    2023-12-08 15:28:48

    文件目录写错了