开发者社区> 问答> 正文

jenkins 执行python script报错

在jenkins中使用python 插件执行脚本时报错
python 的环境变量已经配置。 若用shell执行python 脚本是ok
[workspace] $ python "D:\Program Files\Apache Software Foundation\Tomcat 6.0\temp\hudson8762080438361983685.py"
FATAL: command execution failed java.io.IOException: Cannot run program "python" (in directory "D:\jenkins\jobs\testexample\workspace"): CreateProcess error=2, ?????????
	at java.lang.ProcessBuilder.start(Unknown Source)
	at hudson.Proc$LocalProc.<init>(Proc.java:244)
	at hudson.Proc$LocalProc.<init>(Proc.java:216)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
	at hudson.Launcher$ProcStarter.start(Launcher.java:381)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
	at hudson.model.Build$BuildExecution.build(Build.java:203)
	at hudson.model.Build$BuildExecution.doRun(Build.java:160)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
	at hudson.model.Run.execute(Run.java:1738)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:381)
Caused by: java.io.IOException: CreateProcess error=2, ?????????
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 16 more
Build step 'Execute Python script' marked build as failure
Finished: FAILURE

展开
收起
海边一只船 2020-06-01 14:52:03 908 0
1 条回答
写回答
取消 提交回答
  • 我怀疑是权限问题。 java.io.IOException: CreateProcess error=2,

    2020-06-01 14:52:12
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载