jenkins构建报错‘python‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

一.问题描述

jenkins job 构建失败,查看console output

Building in workspace D:\D1\code\AutoTest\python_interface_autotest\PythonInterfaceAutoTest
[PythonInterfaceAutoTest] $ cmd /c call C:\WINDOWS\TEMP\jenkins2874359305483003602.bat

D:\D1\code\AutoTest\python_interface_autotest\PythonInterfaceAutoTest>python ./chapter7/run/run_main.py 
'python' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

D:\D1\code\AutoTest\python_interface_autotest\PythonInterfaceAutoTest>exit 9009 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

二.问题解决

1.检查我的命令,看在命令行能否运行
jenkins构建报错‘python‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。_第1张图片
jenkins构建报错‘python‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。_第2张图片
如图是可以运行的

2.问题应该是jenkins中缺少python的环境变量

于是修改命令为:

你可能感兴趣的:(自动化测试,jenkins,python,环境变量)