I am having similar problems to the original poster, but the suggestion 
that worked for him did not work for me.  To be specific, I have this setup:

   1. Sage app for Mac in /Applications/Sage-5.3-OSX-64bit-10.6.app/.
   2. Created symlink ~/Library/texmf/tex/sage_generic -> 
   
/Applications/Sage-5.3-OSX-64bit-10.6.app/Contents/Resources/sage/local/share/texmf/tex/generic.
 
    (Although this wasn't exactly the recommended way to do it, it seems to 
   work fine; LaTeX can find the .sty file successfully.)
   3. Pasted exact duplicate of example LaTeX document 
   from http://www.sagemath.org/doc/tutorial/sagetex.html into a new .tex file 
   and saved it as sagetex_test.tex.
   4. Followed directions 
   from 
http://www.math.washington.edu/tex-archive/macros/latex/contrib/sagetex/sagetexpackage.pdf
 
   to activate TeXShop Sage engine and change its internal path to point to 
   the sage inside the app bundle.
   5. Added appropriate line to the top of my LaTeX file (%!TEX TS-program 
   = sage).
   6. Whether I run with the TeXShop engine (which indeed runs sage on the 
   .sage file) or do it manually (just LaTeX the file within TeXShop, then run 
   sage from Terminal myself) I get the same error as the original poster, 
AttributeError: 
   'module' object has no attribute 'openout'.
   7. I have followed Dan's suggestion to the original poster; I ran 
   /Applications/Sage-....app/Contents/Resources/sage/sage -i sagetex-2.1.1 
   and it installed successfully.  However, I realize that there is a newer 
   version since 2009 (this thread's date) but I don't know what it is.  I 
   tried Google, which suggested 2.3.1, but sage said "Error: could not find a 
   package matching sagetex-2.3.1 in http://www.sagemath.org/packages.";

Any tips are welcome--thanks!

Nathan


On Wednesday, September 30, 2009 12:51:46 AM UTC-4, Dan Drake wrote:
>
> On Tue, 29 Sep 2009 at 08:21PM -0700, Jaasiel Ornelas wrote:
> > Then, when I run sage in the file, I get this error:
> > 
> > """"""
> > sanponpon:~ jaasiel$ /Applications/sage/sage Documents/latex_example/
> > xample2/Untitled1.sage
> > Traceback (most recent call last):
> >   File "Documents/latex_example/xample2/Untitled1.py", line 5, in
> > <module>
> >     sagetex.openout('Untitled1')
> > AttributeError: 'module' object has no attribute 'openout'
> > 
> > """"""
>
> That's from an older version of SageTeX, so I'm guessing the Python
> module and style file are from different versions. I recommend doing
> "sage -i sagetex-2.1.1" which will install the Python module into Sage
> (so you don't need to worry about the .py file) and then copying
> sagetex.sty from $SAGE_ROOT/local/share/texmf/tex/generic/sagetex into
> your current directory.
>
> Then the two parts of SageTeX will be using the same version, and it
> should work.
>
> Dan
>
> -- 
> ---  Dan Drake
> -----  http://mathsci.kaist.ac.kr/~drake
> -------
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to