Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Similar to above, the following worked for me from the notebook interface of sage:


Octave was installed on my system using MacPorts.

I found that octave.eval('2+2') worked immediately in the notebook, but octave(2+2), required:

octave = Octave()

otherwise it errored with "ValueError: The octave session in which this object was defined is no longer running."

Note: octave.eval returns a string, usually with "ans =", whereas octave() returns a number that I could perform further operations on.

You may want to put octave.quit(True) at the end. I don't understand what is actually going on well, so take my advice with caution.

see also: