Ask Your Question

sagetex's .sage file gives "runfile is not defined"

asked 2014-12-29 10:07:49 -0500

jim.hefferon gravatar image


SageTeX creates for me a .sage file. When I run Sage on that it fails, giving me an error from Python that the runfile command is not known (after apparently creating a .py file). I didn't see what I am doing wrong in the docs or by googling (sorry if I missed it). I'd be grateful for any tips about how to work around the issue. Here is the command line from a MWE.

$ sage test.sagetex.sage
Processing Sage code for test.tex...
Code block begin...
**** Error in Sage code on line 12 of test.tex! Traceback follows.
Traceback (most recent call last):
  File "", line 9, in <module>
NameError: name 'runfile' is not defined

**** Running Sage on test.sage failed! Fix test.tex and try again.

Here is the MWE.


p = plot_circle_action(1,0,0,1) 
p.set_axes_range(-1.5, 1.5, -0.5, 1.5)"graphics/svd000.png",dpi=1200)

Here is the version.

$ sage --version
Sage Version 6.1.1, Release Date: 2014-02-04

(I'm on a recent Ubuntu.)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-29 14:04:03 -0500

Try using load instead of runfile.

edit flag offensive delete link more


Thank you; out of the many things I tried, I must have missed that one. Appreciate it.

jim.hefferon gravatar imagejim.hefferon ( 2014-12-29 16:55:16 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2014-12-29 10:07:49 -0500

Seen: 96 times

Last updated: Dec 29 '14