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, 28 Apr 2013 12:22:40 +0200SageTex python error IO Error no2https://ask.sagemath.org/question/10052/sagetex-python-error-io-error-no2/When i try to run sage on the produced .sage file i get a python error telling me that the file doesn't exist, but i'm pretty sure that it exists !!Mon, 22 Apr 2013 19:13:09 +0200https://ask.sagemath.org/question/10052/sagetex-python-error-io-error-no2/Comment by kcrisman for <p>When i try to run sage on the produced .sage file i get a python error telling me that the file doesn't exist, but i'm pretty sure that it exists !!</p>
https://ask.sagemath.org/question/10052/sagetex-python-error-io-error-no2/?comment=17827#post-id-17827We need a little more information. It's likely that this is due to an incompatibility between your SageTeX and the version of Sage, though. See (perhaps) [this question](http://ask.sagemath.org/question/1957/version-of-sagetexsty-used-with-version-471) and [this question](http://ask.sagemath.org/question/877/sagetex-after-upgrade-to-sage-472) for some possible diagnoses. Otherwise we need more info.Mon, 22 Apr 2013 22:05:19 +0200https://ask.sagemath.org/question/10052/sagetex-python-error-io-error-no2/?comment=17827#post-id-17827Answer by slelievre for <p>When i try to run sage on the produced .sage file i get a python error telling me that the file doesn't exist, but i'm pretty sure that it exists !!</p>
https://ask.sagemath.org/question/10052/sagetex-python-error-io-error-no2/?answer=14857#post-id-14857Just as a complement to kcrisman's comment and useful links.
You need to use the package `sagetex.sty` from the version of Sage that you are running.
To ensure the correct `sagetex.sty` will be used, copy it to an appropriate location:
- either in the system's texmf hierarchy
- or in your local texmf hierarchy
- or next to the file you are compiling.
If you go for the last option, you could run this sequence of shell commands:
$ cd /working/dir/
$ SAGE_ROOT=`sage -c 'print SAGE_ROOT'`
$ cp $SAGE_ROOT/local/share/texmf/tex/generic/sagetex/sagetex.sty .
(this will copy the correct `sagetex.sty` to your working directory).
Then you can run latex, sage, and latex again to process your file.
$ pdflatex file.tex
$ sage file.sagetex.sage
$ pdflatex file.tex
Sun, 28 Apr 2013 12:22:40 +0200https://ask.sagemath.org/question/10052/sagetex-python-error-io-error-no2/?answer=14857#post-id-14857