[Tex/LaTex] Error when using the python package

errorsmiktexpackagespython

I am very new to LaTeX.
I need to run python package in LaTeX but I can't. I use MiKTeX 2.9 under Windows 7 but the programs gives me this error:

Latex error: ! I can't find file `bin/**filename**.py.out'.

Latex Error: Emergency stop.<read 2> \ end{python}

Best Answer

At the moment python.sty is not in MikTeX package repository. You would have to install it manually.

You can download python.sty from people who have saved the original python.sty by Martin R. Ehmsen. This (bitbucket) is one of such places.

Then copy python.sty to your working directory.

This python.sty needs a python interpreter. You need to install one on Windows. Then modify python.sty to call python.exe instead of /usr/bin/python. I cannot confirm if this would work or not.

This thread on tex.stackexchange.com shows that such modification is possible and provides a version of python.sty modified to work on Windows.

If all goes well you can move it to the local texmf tree as described in MikTeX manual and update path databases.