0

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.

Nitin Prakash
  • 328
  • 3
  • 15
  • These are the external libraries i am using in my script - from jenkinsapi.jenkins import Jenkins from jenkinsapi.utils.crumb_requester import CrumbRequester import jenkins – Arun Dharuman May 29 '18 at 02:59
  • try this ....https://jenkins.io/doc/book/pipeline/shared-libraries/ – rohit thomas May 29 '18 at 03:28

0 Answers0