Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Build agent is using a specific Python version #3952

OnQuickBuild ·

Hi Robin

In one of our build agents, there is a weird issue about shell/batch step:

I select specific agent, it's a windows machine, and the machine has multiple Python versions installed. When I go to the machine directly, and use command prompt to execute "python --version", the machine itself by default uses 3.6.3

And there is another python, 3.6.5. For some reason, when I execute "python --version" in a shell/batch step, Quickbuild specifically uses this version, it reports 3.6.5. Now that I uninstalled this version on that machine (redundant, not needed), quickbuild doesn't even recognize python command anymore.

C:\buildagenttest\workspace\root\Sandbox\testsss>python --version
19:21:55,768 WARN  - 'python' is not recognized as an internal or external command,
19:21:55,769 WARN  - operable program or batch file.
19:21:55,873 INFO  - Executing post-execute action...
19:21:55,875 ERROR - Step 'master>test' is failed: Failed to run command: python --version
Command return code: 1
Command error output: 'python' is not recognized as an internal or external command,
operable program or batch file.

I thought Quickbuild is supposed to control a CMD on that machine, that's all. But why does it behave differently with a CMD directly on that machine?

Thank you for your help!

  • replies 1
  • views 990
  • stars 0
robinshen ADMIN ·

I guess QB agent is installed as service on your machine, and it may have a different environment than your command line. You may either need to specify the python path explicitly or configure the system PATH to include your 3.6.3 version (and restart the agent afterward).