0

I am trying simply to run python --version from Jenkins in both ways, as you see in the image

NOTE:

on the same machine that jenkins runs, if I run the same command or any other Python script, it runs with no problem but via jenkins doesn't recognize it.

enter image description here

and I get the following error:

15:16:19 C:\Project\Jenkins\XXX\XXX\XXX\XXX>exit 0 
15:16:19 [TUNSDK] $ sh -xe C:\Users\XXX\jenkins3628552658524167869.sh
15:16:19 + sh python --version
15:16:19 sh: python: No such file or directory
15:16:19 Build step 'Execute shell' marked build as failure
15:16:20 Finished: FAILURE

How can I run a python script via jenkins

user3122648
  • 887
  • 2
  • 8
  • 21

1 Answers1

0

It seems that you do not have python in the current dir or your full path to python is not available in the system environment. Try to add it to systems variables or place the full path for python.exe in the command line. You could find more information at: How to add to the PYTHONPATH in Windows, so it finds my modules/packages?