I am trying to present my Python script in latex. I have tried using the pyverbatim environment and the \inputpygments package but neither works, with both yielding the error message "Package PythonTeX Warning: Non-existent Pygments content on input line xx". The compiled document simply typsets ?? PythonTeX ??
\documentclass[letterpaper,11pt]{article}
\usepackage{pythontex}
\begin{document}
\begin{pyverbatim}
print(“Hello, World!”)
\end{pyverbatim}
\end{document}
Or try using:
\inputpygments{python}{python.py}
where the file python.py has been uploaded to the project folder in latex.
I have also tried including additional packages such as \usepackage[utf8]{inputenc} and \usepackage[T1]{fontenc} that I noticed others used answering other questions about typesetting one's Python script in Latex, but to no avail.


python3 /usr/local/texlive/2020/texmf-dist/scripts/pythontex/pythontex3.py --rerun=always <your file>.tex(depending on your installation, of course) between twopdflatex(or other engine)? Your mwe ouputs correct result here. – NBur Feb 26 '21 at 13:11\usepackage, not via separate installation. – R_Dax Feb 26 '21 at 13:34