"variable not defined" error after reopening saved python project

3,163 views
Skip to first unread message

Shane Greeno

unread,
Dec 19, 2015, 10:15:36 PM12/19/15
to Project Jupyter
Hi,

I'm new to the Jupyter notebook.  After recently reopening a project that I started, I am getting an error stating that none the previous variables I'd created have been defined when I try to use them.  Any advice on this would be greatly appreciated.  

Thanks!

MinRK

unread,
Dec 21, 2015, 7:11:09 AM12/21/15
to jup...@googlegroups.com
The Kernel is a process where your code runs. Each notebook has a kernel. Variables defined in a notebook live in the memory of this process. If the process is killed or restarted, then those variables are gone, and must be reloaded or recreated.

-MinRK

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/2cbd3e06-6c4b-459e-a612-9012c81d6912%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shane Greeno

unread,
Dec 21, 2015, 11:01:11 PM12/21/15
to Project Jupyter
Thanks for your reply.  So is the answer to leave the notebook always running?

Mario Menezes

unread,
Dec 22, 2015, 3:36:54 AM12/22/15
to Project Jupyter
Hi

A possible mistake is the following: create a variable later in the code, after some error message but forget to put the cell in the proper position in the code.
Then, if when you run the code top-down, after restarting the kernel, that variable won't be defined because its cell is down to the end of the notebook, after it's first mentioned.

Hope this helps.

Martin Sandve Alnæs

unread,
Dec 22, 2015, 3:41:02 AM12/22/15
to jup...@googlegroups.com

No, you just need to execute the cells again in the same order to recreate the variables. If you have deleted cells you cannot reproduce the original result.

Martin

Shane Greeno

unread,
Dec 22, 2015, 9:19:25 PM12/22/15
to Project Jupyter
Problem solved!  I can't believe I didn't think of this.  Thank you.

Shane Greeno

unread,
Dec 22, 2015, 9:19:40 PM12/22/15
to Project Jupyter
Thanks for your help!
Reply all
Reply to author
Forward
0 new messages