First time here? Check out the FAQ!

Ask Your Question
1

UnpicklingError when trying to run notebook()

asked 14 years ago

Peter gravatar image

updated 10 years ago

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?

Preview: (hide)

Comments

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

Peter gravatar imagePeter ( 14 years ago )

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 ( 14 years ago )

2 Answers

Sort by » oldest newest most voted
1

answered 14 years ago

mandrake gravatar image

updated 14 years ago

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..

Preview: (hide)
link

Comments

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 ( 14 years ago )
1

answered 14 years ago

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.

Preview: (hide)
link

Comments

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 ( 14 years ago )

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 14 years ago

Seen: 776 times

Last updated: Nov 22 '10