Quantcast
Channel: python.sty on TeX Live 2013 - Forbidden to open for writing error - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

python.sty on TeX Live 2013 - Forbidden to open for writing error

$
0
0

I have a fresh install of TeX Live 2013 and am attempting to compile a file using the python package. Here is the relevant portion of the file

\begin{python}print 'hi'\end{python}

I've compiled successfully on my linux machine with TeX Live 2013, but cannot get my windows 7 machine to compile successfully. When I run latex --shell-escape pytest.tex I get an error which begins with

pytest.py: Forbidden to open for writing! I can't write on file `pytest.py'.\@python ...mediate \openout \@out =\@outname .py                                                   \newlinechar ='15 \begingr...

Can anyone help me fix this so I can compile latex documents using python.sty on my windows machine?

Update

So I'm pretty certain the issue has to do with permissions. If that is the case it would be really great if there were a few easy tests I could run to determine why \write18 cannot open files for writing / what it is trying to do. I've seen some problems from searching that were related to the TEXMFOUTPUT environment variable, but I don't know (1) what to set as the value of TEXMFOUTPUT in order to make sure that these temporary python files are created in the current working directory and (2) if setting TEXMFOUTPUT would have anything to do with these \write18 permission problems.

Ok, one new piece of information: So, I've created a minimal example:

\documentclass[letterpaper,10pt]{article}\usepackage{python}\begin{document}\begin{python}print 'hi'\end{python}\end{document} 

When compiled after the `! I can't write on file pytest1.py' It says (Press Enter to retry, or Control-Z to exit; default file extension is '.tex' Is this error because write18 can only write to a .tex file?

At the beginning of the compile on the second line it just says ` \write18 enabled'. So it is not running with restricted \write18. I feel like I am really close to fixing this.

Solved

The comment python.sty on TeX Live 2013 - Forbidden to open for writing error was exactly right. I had .py listed in my PATHEXT environment variable. Removing it allowed the file to compile without error.

Just read meta.tex.SE and will credit JosephWright once answer is up.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images