I did notice something strange on my python server running jenkins. Basically if I run a script, which has dependencies (I use python via Brew), from console, it works fine.
But when I run it via Jenkins, I get an error because that package was not found.
When I call the script, I use python -m py.test -s myscript.py
Is there a gotcha when using Jenkins, and call python as I do? I would expect that a command called in the bash section of Jenkins, would execute as if it was running in console, but from the result that I get, it seems that is not true.
When I check for which python, I get back /usr/local/bin/python; which has the symlink to the brew version. If I echo $PYTHONPATH I get back the same path.
One interesting thing though, is that if on Jenkins I call explicitly either /usr/local/bin/python -m or /usr/bin/python ; I get an error saying that there is no python there; but if I just use python -m, it works. This makes no sense to me.
Jenkins is running your jobs as a different user, and typically on a different host (unless you let your Jenkins run on your local host and don't use slaves to run your jobs).  Resulting from these two aspects you will have also a different environment (variables like HOME, PATH, PYTHONPATH, and all the other environment stuff like locales etc.).
To find out the host, let a shell in the job execute hostname.
To find out the Jenkins user, let a shell in the job execute id.
To find out the environment, let a shell in the job execute set (which will produce a lot of output).
My guess would be that in your case the modules you are trying to use are not installed on the Jenkins host.
is Python called differently via Jenkins?