Question

I have a Python script that I want to run as part of a Jenkins project. When I try to run the script via Jenkins, I get an ImportError when it tries to find the gearman module. (Yes, the gearman module is installed on the slave node - I am able to run an interactive Python shell and can successfully import this module.)

This is the exact error:

+ python test.py
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    import gearman, time, sys
ImportError: No module named gearman

How do I let Jenkins know where to look for modules? Thanks!

Was it helpful?

Solution

There's much more information here, but the simplest answer to your question is, in your jenkins build configuration, configure the build step with:

export PYTHONPATH=$PATH_TO_MODULE:$PYTHONPATH
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top