PythonTeX rendering problem

I tried the PythonTeX package, and the output it produced contained question marks instead of running python code, what should i do ??

• Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Moreover, as I read it PythonTeX lets you execute python code, and putting the result back into the document. It is not meant to show the code itself, right?
– mafp
Apr 3 '13 at 23:48
• I haven't used PythonTeX but I've used similar packages (SageTeX) which give the same ?? unless you process it in 3 stages: run latex on the document (the output will be the question marks you've seen) and a special file will be created (with sage it's a .sage file). Next, run the script/program on that special file. Finally, latex the document again. Question marks should be gone if the code was valid. I googled up this video on PythonTeX where the author mentions the 3 step process at the 9:30 mark. Have you done the 3 step process?
– DJP
Apr 4 '13 at 0:30
• DJP is correct; PythonTeX's operation uses the same principle as SageTeX. You have to run LaTeX (this saves all the Python code in an auxiliary file), then run the PythonTeX script (pythontex2.py or pythontex3.py, depending on your Python version), and finally run LaTeX again (which brings in the output of the script). There are question marks/placeholders for any code output that is expected but not yet available, with corresponding warnings. Apr 4 '13 at 1:29
• @DJP I guess that is the problem, i didn't know that i should run the python script, thank you Apr 4 '13 at 13:16
• @DJP you should post this as answer, so this question won't remain "unanswered" Apr 11 '13 at 6:54

Packages which call other programs, such as sagetex, python, gnuplot, or (as G. Poore confirms) PythonTeX require you to process the your document in a similar fashion: 1. (pdf)latex your document to create a special file (with sagetex it's a .sage file. 2. Process the special file with the program/script (Sage/Python/gnuplot) 3. (pdf)latex your document again.