I have a Sage notebook server that runs in a screen session on Ubuntu Server 14.04 (32-bit). When I'm ssh'd to the machine, I can use my notebook in my browser as expected. If I'm not ssh'd to the machine (but notebook server still running in screen session), I can still log in and open my notebook, but when I press SHIFT+ENTER in a compute cell, I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_3.py", line 8, in <module>
NameError: name '_interact_' is not defined

If I then go ssh back into the machine, I close and reopen the notebook (log out from the server is not necessary), and I can use compute cells normally again. I don't even have to be attached to the screen session, just logged in to the host.

I thought the most likely culprit would be related to the eCryptfs of my home dir, so I created /var/sage/sage_notebook.sagenb, but I still get the error*. Currently, the permissions are at 750, but I also tried 777 without success.

The issue is clearly something that's missing when I'm not logged in, but I can't figure out what. The server is a pretty vanilla, ext4 install. Does anyone know what I'm missing?

*Actually, I was getting permission denied errors when the notebook dir was in my home dir and I wasn't logged in. The error shown is what I'm seeing now that I've moved to /var/sage/...

  • Although the old sagenb is not being currently worked on much, you could ask this question on the Sage support Google group, ask.sagemath.org or even stackoverflow and possible get an answer. You certainly shouldn't have to create the directory in question, that should definitely be automatic.
    – kcrisman
    Mar 14, 2017 at 19:11

1 Answer 1


Answer was provided on Unix SE.

I had moved the notebook dir out of my home dir, but Sage was still accessing its config in ~/.sage. Setting export HOME=/var/sage worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .