ipynb crash and cannot recover work


I was recently working on an ipynb with a lot of data. Dataspell ran out of memory, and proceeded to crash. However, upon reopening Dataspell, the ipynb was empty, and is a 0 bytes on disk (attempting to open gives Unreadable Notebook: ... NotJSONError("Notebook does not appear to be JSON: ''..." error) . Local History shows no past versions saved to which I can revert the ipynb, so it appears all my work is lost? This is despite running over 100 cells successfully before the crash. Is Dataspell not using the .ipynb_checkpoints directory? As nothing was in that directory either. Any help on recovering my notebook would be greatly appreciated!

Comment actions Permalink

If none of the above helped, I found a workaround to recover most of the changes I did since the last checkout - by simply calling this command in your notebook:

%history -g
If you want your IPython history in a plain-text file, you can export it yourself.

You can also do it for a specific filename:

%history -g -f filename 
What does -g do? – Without -g it exports the history for the current session. With -g it exports history for all sessions.

MyTHDHR Schedule

Comment actions Permalink

I recommend you to uninstall and re-install all the below items:

  • ipykernel
  • ipython
  • jupyter_client
  • jupyter_core
  • traitlets
  • ipython_genutils

Additionally, if you're going to install with conda, follow below command.

run conda clean -tipsy

This command will clean up conda caches before you start

the backrooms


Please sign in to leave a comment.