这是控制台输出中显示的错误。给定python配置文件的特定路径。还在系统和用户环境变量中指定了路径。
Running as SYSTEM
Building on master in workspace C:Windowssystem32configsystemprofileAppDataLocalJenkins.jenkinsworkspacepyproj
[pyproj] $ python C:WindowsTEMPjenkins1868508063547381339.py
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:487)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
Caused: java.io.IOException: Cannot run program "python" (in directory "C:Windowssystem32configsystemprofileAppDataLocalJenkins.jenkinsworkspacepyproj"): CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at hudson.Proc$LocalProc.<init>(Proc.java:253)
at hudson.Proc$LocalProc.<init>(Proc.java:222)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:996)
at hudson.Launcher$ProcStarter.start(Launcher.java:508)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:144)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:92)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:21)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:808)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:164)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:516)
at hudson.model.Run.execute(Run.java:1889)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:100)
at hudson.model.Executor.run(Executor.java:433)
Build step 'Execute Python script' marked build as failure
Finished: FAILURE
它在抱怨找不到python
。不是指定了Python二进制文件的完整路径。
你确定这个系统上安装了Python吗?
根据它的安装方式和位置,尝试将c:python39
添加到PATH
;参见如何在Windows上设置Jenkins配置中的PATH环境变量?对细节。