Ask Your Question

UnpicklingError when trying to run notebook()

asked 2010-11-05 21:15:58 +0200

Peter gravatar image

updated 2015-01-14 09:46:02 +0200

FrédéricC gravatar image

When I first downloaded and installed Sage (several versions ago) to try it out on Ubuntu, everything worked without error. I didn't do much with it, time passed, and when I came back to Sage, I saw 4.6 was there. I completely erased the folder that Sage was in, downloaded and untarred 4.6, and ran Sage. That's fine--commands input in the terminal work fine. But when I try to run notebook(), I get

UnpicklingError Traceback (most recent call last)

/home/me/.sage/<ipython console=""> in <module>()

/home/me/Math/sage46/devel/sagenb/sagenb/notebook/notebook_object.pyc in __call__(self, args, *kwds) 215 """ 216 def __call__(self, args, *kwds): --> 217 return self.notebook(args, *kwds) 218 219 notebook = run_notebook.notebook_twisted . . . UnpicklingError: invalid load key, 'n'.

I know how to spell Python, but not much more. Any idea what got messed up and suggestions on how to fix it?

edit retag flag offensive close merge delete


BTW, what I downloaded was sage-4.6-linux-32bit-ubuntu_10.04_lts-i686-Linux.tar.lzma

Peter gravatar imagePeter ( 2010-11-05 21:23:25 +0200 )edit

Any ideas? I get this error consistently when I do a complete reinstall of Sage. Since others don't get it, and since I didn't get it the very first time I installed a prior level of Sage, I assume there's something about my environment that causes this. But I thought I read that Sage comes with everything it uses, so I have no idea what in my environment could cause the problem.

Peter gravatar imagePeter ( 2010-11-21 11:07:22 +0200 )edit

2 Answers

Sort by » oldest newest most voted

answered 2010-11-22 09:27:20 +0200

mandrake gravatar image

updated 2010-11-22 09:30:42 +0200

This might or might not work for you. When I had problems with unpickling this worked for me.

Make notebook start again

If you have valuable information in your /home/sage/.sage/sage_notebook.sagenb/ folder, try to just erasing/renaming:

  • /home/sage/.sage/sage_notebook.sagenb/conf.pickle
  • /home/sage/.sage/sage_notebook.sagenb/user.pickle

Recover worksheet

If you lost information, look for snapshots of your worksheet in: /home/sage/.sage/sage_notebook.sagenb/user.pickle/home/<user>/<worksheet id>/snapshots/

  • Unpack latest snapshot
  • Copy contents of file
  • Edit worksheet in browser in plain text mode
  • Paste the contents.
  • Press save

Maybe there's an easier way, but I haven't found it yet..

edit flag offensive delete link more


Thanks for posting the details of the paths and specific pickle files. Since I'm just trying Sage out, I didn't have to recover information, but I'll remember that this procedure is here. I don't know all the factors that can affect Sage's paths, but I actually found the snapshots, presumably the .bz2 files, under .../.sage/sage_notebook.sagenb/home/<user>/<worksheet id="">/snapshots.

Peter gravatar imagePeter ( 2010-11-26 21:13:40 +0200 )edit

answered 2010-11-21 12:02:39 +0200

pang gravatar image

The problem is within the .sage in your home folder. It contains the folder "sage_notebook.sagenb" with information about the worksheets you have created since your first install. Try to rename .sage into .sage-old and see if it works. If you don't need the notebooks there, you can simply erase it.

edit flag offensive delete link more


Yes, renaming the folder took care of the problem. And realizing that there was such a folder was a big step forward. I see nothing in the Installation Guide that states explicitly that the Sage installation creates it. Now that I know it's there, I understand the statement in the Installation Guide about the DOT_SAGE environment variable. Thank you!

Peter gravatar imagePeter ( 2010-11-26 20:55:48 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2010-11-05 21:15:58 +0200

Seen: 646 times

Last updated: Nov 22 '10