1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Kernel crashed while dumping via pickle, 'EOFError: Ran out of input' when trying to...

Discussão em 'Python' iniciado por Stack, Setembro 27, 2024 às 17:02.

  1. Stack

    Stack Membro Participativo

    As described, was in the process of writing to an existing pkl file when the Spyder kernel crashed and restarted.

    Attempting to read pickle contents to see what had saved gave the below error.

    Traceback (most recent call last):

    File "/tmp/ipykernel_363621/4257573313.py", line 2, in <module>
    [book_df,levels,levels_df,clean_book,clean_levels,time_labels,esu_l2,esu_tos,p_m] = pickle.load(h)

    EOFError: Ran out of input


    Have found a number of related questions but none of the remedies appear to resolve the issue.

    Can confirm .pkl file I'm reading/writing to still exists in same location. Have included code I'm running below:

    with open('/home/chris/data/ng/depth.pkl', 'rb') as h:
    [book_df,levels,levels_df,clean_book,clean_levels,time_labels,esu_l2,esu_tos,p_m] = pickle.load(h)

    Traceback (most recent call last):

    File "/tmp/ipykernel_363621/4257573313.py", line 2, in <module>
    [book_df,levels,levels_df,clean_book,clean_levels,time_labels,esu_l2,esu_tos,p_m] = pickle.load(h)

    EOFError: Ran out of input


    Have tried the below to close the file (assuming it's locked as a result of Spyder crashing before it could be closed previously). Neither remedy the error.

    open('/home/chris/data/ng/depth.pkl', 'a').close()


    ..

    f = open('/home/chris/data/ng/depth.pkl', 'rb')
    f.close()

    Continue reading...

Compartilhe esta Página