4
votes

Python works fine on command prompt but failed to run from Jenkins and gives error

'python' is not recognized as an internal or external command, operable program or batch file.

2

2 Answers

5
votes

I closed all the command windows and closed the jenkins client. Then again connected the jenkins client on slave and it worked for me

4
votes

I had this issue in WINDOWS 10:

To fix that you may try what worked for me:

  1. first you have to add the parent directory into the windows environment path: from windows start menu search for 'edit the system environment variables' -> 'environment Variables' -> double check the Path -> enter to parent directory of python installation

  2. jenkins - > manage jenkins -> Configure System -> Environment variables -> ADD: Name: path Value: all your parent folders in 1. above (that can be extracted also using the batch command "echo %path%" - copy and past)