ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 11 May 2015 09:14:22 -0500Running .sagetex.sage fails to return the 'out' filehttp://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/ 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?
Fri, 08 May 2015 17:49:21 -0500http://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/Answer by ianjmatthews for <p>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</p>
<pre><code>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'
</code></pre>
<p>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?</p>
http://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/?answer=26788#post-id-26788Now 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 itSun, 10 May 2015 10:50:47 -0500http://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/?answer=26788#post-id-26788Comment by kcrisman for <p>Now tried running the ...sagetex.sage files from two different locations, and two different documents.</p>
<p>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.</p>
<p>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.</p>
<p>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</p>
http://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/?comment=26797#post-id-26797SageTeX 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.Mon, 11 May 2015 09:14:22 -0500http://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/?comment=26797#post-id-26797Answer by kcrisman for <p>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</p>
<pre><code>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'
</code></pre>
<p>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?</p>
http://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/?answer=26772#post-id-26772I 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.Fri, 08 May 2015 21:33:59 -0500http://ask.sagemath.org/question/26769/running-sagetexsage-fails-to-return-the-out-file/?answer=26772#post-id-26772