Ask Your Question

# Running .sagetex.sage fails to return the 'out' file

asked 2015-05-08 17:49:21 -0600

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Have compiled Latex on the doc st_example. Returns the expected result, including the file st_example.sagetex.sage I then run this file via the terminal using the command $sage (path to ).st_example.sagetex.sage This seems to be OK until it gets to the last line of the file when the following errors are shown Traceback (most recent call last): File "/home/ian/disks/Tex_docs/Alltrials/alltests/st_example.sagetex.sage.py", line 29, in <module> _st_.endofdoc() File "/home/ian/sage-6.6/local/lib/python2.7/site-packages/sagetex.py", line 282, in endofdoc sagef = open(self.filename + '.sagetex.sage', 'r') IOError: [Errno 2] No such file or directory: 'st_example.sagetex.sage'  The problem seems to be in the .py file where the path to st_example is not picked up and hence the 'out' file is not produced. I'm running Python 2.7 and the install of sage is recent ie one day ago. Everything else is working perfectly. is the generated .py file still expecting python 2.6 (as in the documentation) or is the final line of the python code incorrect? edit retag close merge delete ## 2 answers Sort by » oldest newest most voted Now tried running the ...sagetex.sage files from two different locations, and two different documents. On both, I cd via the terminal to ensure I'm in the directory / subdirectory containing the sagetex.sage files . I then try both approaches: Firstly running the sagetex.sage file from within the main sage-6.6 directory (using ./<name>.sagetex.sage) and then try again running from outside the sage-6.6 directory and the same ./ ... approach. I do not get the same error as before, but this time it gives me a syntax error on line 4 of the ...sagtex.sage files. Checking the syntax (the line checks that the versions match) I can see no obvious error - I'm assuming that the syntax is based on python syntax. The other approach I've tried is to run the files from the interactive sage using the 'load' command. This also gives the original 'file not found' error. However, I think the python version is iPython, but I'm not clear whether this makes any difference. The comment 'sage being finicky' is well made, I guess much of linux / ubuntu tends to involve a fair degree of trial and error. I'll keep trying and any other ideas are welcomed and if I get a result I'll obviously post it more ## Comments SageTeX is the one that is finicky ... This is puzzling, and perhaps has something to do with the specifics. Can you post a "minimal example" of what is/isn't working? (Ideally, a very short document one could try running TeX and SageTeX on.) Hopefully we can then help you further. ( 2015-05-11 09:14:22 -0600 )edit I don't think the Python version matters, as long as the Sage version and sagetex.sty are in sync. Have you tried compiling this from inside the directory, ala $ /path/to/sage st_example.sagetex.sage


instead of the other way around? No guarantees but I remember SageTeX being kind of finicky in this way.

more

## Your Answer

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

Add Answer

## Stats

Asked: 2015-05-08 17:49:21 -0600

Seen: 443 times

Last updated: May 10 '15