"The system cannot run the specified program." Python 3.9

Well I just installed and I’m testing with jenkins, to perform my automated tests, which are currently with unittest and pytest, the problem arose when I run the same commands that I do out of jenkins, and I noticed that the error is with python, I researched a lot but everyone said I should add the environment variables, and I did, but I still have that error, could you help me?

Jenkin’s Console:

Launched by user Test
Running as SYSTEM
Running in the workspace C:
[UnitTest $ cmd /c call C:\WINDOWS\TEMP\jenkins3178157461583014590.bat
C:\ python -V
The system cannot run the specified program.

Jenkin’s Job

python -V

I have tried to enter the global variables inside the jenkins configuration, the PATH variable and the Python variable inside and outside the path, I also tried to do it by windows command and powershell command, I also tried to do it by a bat file and run it in the console, but I got the same problem.
Before entering the path I got the error that the command is not recognized, but then I got the error that the system cannot run the specified program.
I want to be able to run python inside the jenkins console.

Hi there,

“it doesn’t work” is always hard to remote debug. Try to always include these 3 things.

  1. what did you try? (Code samples, command lines, screenshots, videos, etc)
  2. what did happen? (Error messages, description, outputs, stuff)
  3. what did you expect to happen?

Otherwise, it’s hard for us to get into your context and you’ll have to have someone who is exactly knowledgeable come along.

1 Like

Sorry for not going into more detail, now I edit it

Whenever I have issues with a batch job I specify the full path to the executable to be sure.

For example:
C:\python39\python.exe -v