ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 19 Apr 2015 18:41:42 +0200sagetex on Mac OS 10.10.2https://ask.sagemath.org/question/26589/sagetex-on-mac-os-10102/I am encountering errors. So, I attempted to ensure that I have the right sagetex.sty file as that
seems to be crucial. There was an old one somewhere in LiveTex so I updated to LiveTex 2014.
Turns out that does not include any sagetex.sty. The one I have shows a creation date of March 19,2009.
The error I get is "module does not have an openout method." When I look at the errors in detail
it looks like a python module is automatically generated that tries to insert something into the path,
and what it tries to insert is incorrect, mentioning Applications/sage instead of Applications/Sage-6.5.app.
(See copy of the errors at the end of this message). Now to come to the questions: (1) is this indeed
fixable by getting the right version of sagetex.sty? (2) if so where do I get it?
/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach)
265 with open(preparse_file_named(fpath)) as f:
266 code = compile(f.read(), preparse_file_named(fpath), 'exec')
--> 267 exec(code, globals)
268 else:
269 # Preparse in memory only for speed.
/Users/beeson/.sage/temp/Michaels-MacBook.local/68123/SageTexTest.sageyxLpLD.py in <module>()
7 sys.path.insert(_sage_const_0 , '/Applications/sage')
8 import sagetex
----> 9 sagetex.openout('SageTexTest') Sat, 18 Apr 2015 18:21:54 +0200https://ask.sagemath.org/question/26589/sagetex-on-mac-os-10102/Comment by beeson for <p>I am encountering errors. So, I attempted to ensure that I have the right sagetex.sty file as that
seems to be crucial. There was an old one somewhere in LiveTex so I updated to LiveTex 2014.
Turns out that does not include any sagetex.sty. The one I have shows a creation date of March 19,2009.
The error I get is "module does not have an openout method." When I look at the errors in detail
it looks like a python module is automatically generated that tries to insert something into the path,
and what it tries to insert is incorrect, mentioning Applications/sage instead of Applications/Sage-6.5.app.
(See copy of the errors at the end of this message). Now to come to the questions: (1) is this indeed
fixable by getting the right version of sagetex.sty? (2) if so where do I get it?</p>
<p>/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach)
265 with open(preparse_file_named(fpath)) as f:
266 code = compile(f.read(), preparse_file_named(fpath), 'exec')
--> 267 exec(code, globals)
268 else:
269 # Preparse in memory only for speed.</p>
<p>/Users/beeson/.sage/temp/Michaels-MacBook.local/68123/SageTexTest.sageyxLpLD.py in <module>()
7 sys.path.insert(_sage_const_0 , '/Applications/sage')
8 import sagetex
----> 9 sagetex.openout('SageTexTest') </p>
https://ask.sagemath.org/question/26589/sagetex-on-mac-os-10102/?comment=26598#post-id-26598OK, now I have a sagetex.sty with copyright date 2012. (In case it helps anyone else, the Mac finder does not display this file buried in the Sage installation, even after specifying "show system files", which does cause the ones in (the old) Texlive to show up. Use the Unix command "locate sagetex.sty".) And I discovered that the new sagetex.sty does not generate Myfile.sage but rather Myfile.sagetex.sage. So you need to load or attach THAT file. But I'm still not home free. It seems the generated python code needs to prepend "./" to the filename. It does not do that so it can't run the generated Sage code:
-> 282 sagef = open(self.filename + '.sagetex.sage', 'r')
283 m = hashlib.md5()
284 for line in sagef:
IOError: No such file or directorySun, 19 Apr 2015 18:41:42 +0200https://ask.sagemath.org/question/26589/sagetex-on-mac-os-10102/?comment=26598#post-id-26598Answer by kcrisman for <p>I am encountering errors. So, I attempted to ensure that I have the right sagetex.sty file as that
seems to be crucial. There was an old one somewhere in LiveTex so I updated to LiveTex 2014.
Turns out that does not include any sagetex.sty. The one I have shows a creation date of March 19,2009.
The error I get is "module does not have an openout method." When I look at the errors in detail
it looks like a python module is automatically generated that tries to insert something into the path,
and what it tries to insert is incorrect, mentioning Applications/sage instead of Applications/Sage-6.5.app.
(See copy of the errors at the end of this message). Now to come to the questions: (1) is this indeed
fixable by getting the right version of sagetex.sty? (2) if so where do I get it?</p>
<p>/Applications/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach)
265 with open(preparse_file_named(fpath)) as f:
266 code = compile(f.read(), preparse_file_named(fpath), 'exec')
--> 267 exec(code, globals)
268 else:
269 # Preparse in memory only for speed.</p>
<p>/Users/beeson/.sage/temp/Michaels-MacBook.local/68123/SageTexTest.sageyxLpLD.py in <module>()
7 sys.path.insert(_sage_const_0 , '/Applications/sage')
8 import sagetex
----> 9 sagetex.openout('SageTexTest') </p>
https://ask.sagemath.org/question/26589/sagetex-on-mac-os-10102/?answer=26593#post-id-26593> (2) if so where do I get it?
http://www.sagemath.org/doc/tutorial/sagetex.html
http://www.sagemath.org/doc/installation/sagetex.html
> The key to this is that TeX needs to be able to find sagetex.sty, which can be found in SAGE_ROOT/local/share/texmf/tex/generic/sagetex/, where SAGE_ROOT is the directory where you built or installed Sage. If TeX can find sagetex.sty, then SageTeX will work. There are several ways to accomplish this.
In short, the sagetex.sty is so specifically dependent upon the version of Sage that it has been removed from TeXLive. So you have to use the one included inside your Sage installation, which luckily will definitely be there inside your Sage-6.5.app bundle. Let us know if you need some more details, though it sound like this will be plenty of information for you based on your question.Sun, 19 Apr 2015 03:16:40 +0200https://ask.sagemath.org/question/26589/sagetex-on-mac-os-10102/?answer=26593#post-id-26593