0

I have a full installation of Texlive 2019 and both 2.7 and 3.7 versions of Python installed. I want to compile the following simple project wich contains a python command inside pythontex environment.

\documentclass{article}
\usepackage{amsmath}
\usepackage{pythontex}

\begin{document}
\begin{pycode} 
print ('Hello, World')
\end{pycode}
\end{document}

I first compile with pdflatex and when I run pythontex test.tex python command the error I get is

C:\texlive\2019\bin\win32\runscript.tlu:931:
C:\texlive\2019\bin\win32\runscript.tlu:898: 
program not found (not part of TeX Live): python.exe

but I don't know if TexLive or Python installation is responsible for this. I tried to update Texlive but the problem remains. I also followed instuctions from this topic: Pythontex doesn't work

mac
  • 1,479
  • Pythontex cannot fined python; that's what the error message says. Can you run python on the commandline? Is it in the search path? See also https://github.com/gpoore/pythontex/issues/123 – Willie Wong Nov 25 '19 at 19:16
  • 1
    There are troubles with having two versions of python and using pythonTeX. There might be some advice in documentation. But, from my experience, best results are when you have one version of Python in your PATH. – Tomáš Kruliš Nov 25 '19 at 21:19
  • I can run Python on the command line without problems. But I just installed in another computer Python 3.7 on Program Files (x86) folder and not the default one which is AppData and by adding Python to the Path the problem is fixed. However I haven't tried it yet on my computer which has a different version of Python. – mac Nov 25 '19 at 22:12
  • I tried the same thing but I can't get it to work. Python is already in search path but I get the same error. – mac Nov 26 '19 at 00:24
  • The reason of the issue was multiple installations of Python. Now the problem is solved. – mac Nov 26 '19 at 00:39

0 Answers0