——————————
All the environment is installed with the “source framework_env.sh” before script.py …
The produceData.py works fine when I run it manually on Jenkins server. When it is used in the pipeline it crashes. The error message says that some libraries that should have been loaded are missing.
I do not understand why the program works in the first case and doesn’t work with Jenkins.
Is the part of the pipeline:
sh ‘’’
python produceData.py
‘’’
the same as doing
bash$ python produceData.py on the Jenkins terminal (connected as Jenkins user) ?
Really depends on your setup, but short of it, likely either the libs are not installed on your agent or your environment is not setup correctly and it is not finding it. I would advise against assuming you know what is preinstalled on your agent and just use a venv and install what you need.
This problem sounds like a case of differences between environments. Often caused by a different user, or even a non desktop environment running your agent vs your login session.
I would recommend running a tool to export your environmental variables (set in windows, export or printenv in linux) in both your job and your “command prompt” to see whats different.
Often its something like HOME is set different. Or PATH has changed since its managed by jenkins agent settings. Or even a license key is missing.
Thank you mlasevich and halkeye for the suggestions!!
I investigated the setup using printenv and the PATH but I did not find any differences.
The code I am using is very complex. The “missing” libraries are created dynamically and included in the setup with a general command that is difficult to track.
Is there anything else I can try in order to check if Jenkins makes some changes?