ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 26 Nov 2010 14:13:40 -0600UnpicklingError when trying to run notebook()http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/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
<code>
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'.
</code>
I know how to spell Python, but not much more. Any idea what got messed up and suggestions on how to fix it?Fri, 05 Nov 2010 15:15:58 -0500http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/Comment by Peter for <p>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 </p>
<p><code></code></p><code>
<p>UnpicklingError Traceback (most recent call last)</p>
<p>/home/me/.sage/<ipython console=""> in <module>()</p>
</code><p><code>/home/me/Math/sage46/devel/sagenb/sagenb/notebook/notebook_object.pyc in __call__(self, <em>args, *</em>kwds)
215 """
216 def __call__(self, <em>args, *</em>kwds):
--> 217 return self.notebook(<em>args, *</em>kwds)
218
219 notebook = run_notebook.notebook_twisted
.
.
.
UnpicklingError: invalid load key, 'n'.
</code></p>
<p>I know how to spell Python, but not much more. Any idea what got messed up and suggestions on how to fix it?</p>
http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22516#post-id-22516BTW, what I downloaded was sage-4.6-linux-32bit-ubuntu_10.04_lts-i686-Linux.tar.lzmaFri, 05 Nov 2010 15:23:25 -0500http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22516#post-id-22516Comment by Peter for <p>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 </p>
<p><code></code></p><code>
<p>UnpicklingError Traceback (most recent call last)</p>
<p>/home/me/.sage/<ipython console=""> in <module>()</p>
</code><p><code>/home/me/Math/sage46/devel/sagenb/sagenb/notebook/notebook_object.pyc in __call__(self, <em>args, *</em>kwds)
215 """
216 def __call__(self, <em>args, *</em>kwds):
--> 217 return self.notebook(<em>args, *</em>kwds)
218
219 notebook = run_notebook.notebook_twisted
.
.
.
UnpicklingError: invalid load key, 'n'.
</code></p>
<p>I know how to spell Python, but not much more. Any idea what got messed up and suggestions on how to fix it?</p>
http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22479#post-id-22479Any 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.Sun, 21 Nov 2010 04:07:22 -0600http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22479#post-id-22479Answer by pang for <p>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 </p>
<p><code></code></p><code>
<p>UnpicklingError Traceback (most recent call last)</p>
<p>/home/me/.sage/<ipython console=""> in <module>()</p>
</code><p><code>/home/me/Math/sage46/devel/sagenb/sagenb/notebook/notebook_object.pyc in __call__(self, <em>args, *</em>kwds)
215 """
216 def __call__(self, <em>args, *</em>kwds):
--> 217 return self.notebook(<em>args, *</em>kwds)
218
219 notebook = run_notebook.notebook_twisted
.
.
.
UnpicklingError: invalid load key, 'n'.
</code></p>
<p>I know how to spell Python, but not much more. Any idea what got messed up and suggestions on how to fix it?</p>
http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?answer=11793#post-id-11793The 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.Sun, 21 Nov 2010 05:02:39 -0600http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?answer=11793#post-id-11793Comment by Peter for <p>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.</p>
http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22474#post-id-22474Yes, 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!Fri, 26 Nov 2010 13:55:48 -0600http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22474#post-id-22474Answer by mandrake for <p>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 </p>
<p><code></code></p><code>
<p>UnpicklingError Traceback (most recent call last)</p>
<p>/home/me/.sage/<ipython console=""> in <module>()</p>
</code><p><code>/home/me/Math/sage46/devel/sagenb/sagenb/notebook/notebook_object.pyc in __call__(self, <em>args, *</em>kwds)
215 """
216 def __call__(self, <em>args, *</em>kwds):
--> 217 return self.notebook(<em>args, *</em>kwds)
218
219 notebook = run_notebook.notebook_twisted
.
.
.
UnpicklingError: invalid load key, 'n'.
</code></p>
<p>I know how to spell Python, but not much more. Any idea what got messed up and suggestions on how to fix it?</p>
http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?answer=11795#post-id-11795This might or might not work for you. When I had problems with unpickling this worked for me.
<h2>Make notebook start again</h2>
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`
<h2> Recover worksheet</h2>
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..
Mon, 22 Nov 2010 02:27:20 -0600http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?answer=11795#post-id-11795Comment by Peter for <p>This might or might not work for you. When I had problems with unpickling this worked for me.</p>
<h2>Make notebook start again</h2>
<p>If you have valuable information in your <code>/home/sage/.sage/sage_notebook.sagenb/</code> folder, try to just erasing/renaming:</p>
<ul>
<li><code>/home/sage/.sage/sage_notebook.sagenb/conf.pickle</code></li>
<li><code>/home/sage/.sage/sage_notebook.sagenb/user.pickle</code></li>
</ul>
<h2> Recover worksheet</h2>
<p>If you lost information, look for snapshots of your worksheet in:
<code>/home/sage/.sage/sage_notebook.sagenb/user.pickle/home/<user>/<worksheet id>/snapshots/</code></p>
<ul>
<li><strong>Unpack</strong> latest snapshot</li>
<li><strong>Copy</strong> contents of file</li>
<li>Edit worksheet in browser in <strong>plain text</strong> mode</li>
<li><strong>Paste</strong> the contents.</li>
<li>Press <strong>save</strong></li>
</ul>
<p>Maybe there's an easier way, but I haven't found it yet..</p>
http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22473#post-id-22473Thanks 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. Fri, 26 Nov 2010 14:13:40 -0600http://ask.sagemath.org/question/7752/unpicklingerror-when-trying-to-run-notebook/?comment=22473#post-id-22473