I have a GitHub - python project with 2 scripts. I can run one script in Jenkins using shell command - python script_1_name.py
(this script doesn't have any external packages imported). I have another script which has a external packages - jenkinsapi
and jenkins
. when i try to run this script using shell command in jenkins - python script_2_name.py
, I am getting the below error.
***22:29:36 File "createJenkinsJobs.py", line 1, in <module>
22:29:36 from jenkinsapi.jenkins import Jenkins
22:29:36 ImportError: No module named jenkinsapi.jenkins
22:29:36 Build step 'Execute shell' marked build as failure
22:29:36 Finished: FAILURE***
Since i have these packages installed in virtual environment, i can successfully execute them in local. How to execute this using jenkins job.