今天java调用Python的部分突然报错,具体如下:
java.io.IOException: Cannot run program "python": error=0, Failed to exec spawn helper.
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at java.base/java.lang.Runtime.exec(Runtime.java:589)
at java.base/java.lang.Runtime.exec(Runtime.java:448)
at com.ustcinfo.devops.auto.operation.core.util.ftpUtil.PythonUtil.exePython(PythonUtil.java:25)
at com.ustcinfo.devops.auto.operation.core.service.ScriptExecutionService.exeScriptPython(ScriptExecutionService.java:141)
at com.ustcinfo.devops.auto.operation.core.controller.ScriptExecutionController.exeScript(ScriptExecutionController.java:159)
最后找了半天原因没有找到,重启 服务以后解决了这个问题
后期如果找到具体的原因再更新