I found this a few days ago. I’m running OS X 10.9.1 with Python 2.7.3 and the latest VPython 5.
http://python-in-the-lab.blogspot.com/2013/11/running-python-code-in-latex-document.html
When I process the following LaTeX source the output indicates that there’s no module named visual. Yet when I put the two lines of Python in a separate file and run it form a Terminal window it works perfectly. Am I specifying the correct python executable in the \usepackage line that loads the python package?
\documentclass{article}
\usepackage[bin=python2.7]{python}
\usepackage{amsmath}
\begin{document}
\begin{python}
from visual import *
sphere()
\end{python}
\end{document}
Joe Heafner
Sent from one of my Macs
From: Bruce S. <Bru...@nc...> - 2013-12-21 19:39:15
One possibility might be that running from LaTeX invokes the Python that is
installed with OSX, not the Python from python.org that VPython depends on.
Presumably you meant to say VPython 6, not 5?