I'm working with Windows 8, TeX Live 2015, and Python 3.4. I'm a newbie in LaTeX!
The installation of pythontex
seems to be ok. I verify if all the files are at the right place. I try to make pythontex
work with this code:
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pythontex}
\begin{document}
\begin{pycode}
print ("Hello \Latex ")
\end{pycode}
\end{document}
When I run in cmd
:
pdflatex test.tex
→ okpythontex.py test.py
→ the file command doesn't exit
Do you have any idea of what's wrong?
Best Answer
In addition to needing to correct the
\LaTeX
issue, you have a space before the print command. Python will treat this as an improper indentation. Take the space out. I ran the following code from inside TeXStudio, using a User command ofpythontex %.tex
in the user0 spot (ALT+SHIFT+F1).Don't forget to run
pdflatex
again after runningpythontex
.Also, you must run
pythontex test.tex
nottest.py
.The section of pythontex code that is throwing the latest error is in
pythontex3.py
in the...your TeX distribution folder/scripts/pythontex
folder. It says:So it looks like there is an old version setting hanging around somewhere. I'm not intimately familiar with all the settings and locations. Geoff Poore (the author) is a colleague, but he's not in the office right now. I'm sorry I can't give you more assistance immediately.