edit python.exe must be in a directory defined in the executable path variable PATH . Following working example assumes the presence of C:\Python33\python.exe <project name="demo" default="main" basedir="."> <property environment="env" /> <echo>PATH is set as: ${env.PATH}</echo> <target name="main"> <exec dir="backend/generated" executable="python"> <arg line="--version"/> </exec> </target> </project> execute in a command session set PATH=C:\Python33;%PATH% ant output Buildfile: X:\temp\build.xml [echo] PATH is set as: C:\Python33;... ... main: [exec] Python 3.3.0 edit Just checked. The executable can be executable="python" or executable="python.exe" . So @cdarke is right the issue is that python.exe is not in PATH .
SubOptimal · 9y ago
edit python.exe must be in a directory defined in the executable path variable PATH . Following working example assumes the presence of C:\Python33\python.exe <project name="demo" default="main" basedir="."> <property environment="env" /> <echo>PATH is set as: ${env.PATH}</echo> <target name="main"> <exec dir="backend/generated" executable="python"> <arg line="--version"/> </exec> </target> </project> execute in a command session set PATH=C:\Python33;%PATH% ant output Buildfile: X:\temp\build.xml [echo] PATH is set as: C:\Python33;... ... main: [exec] Python 3.3.0 edit Just checked. The executable can be executable="python" or executable="python.exe" . So @cdarke is right the issue is that python.exe is not in PATH .
cdarke · 9y ago
Check that your %path% environment variable contains the directory that python.exe resides in.
any · 9y ago
@cdarke my Path value is C:\Program Files\Java\jdk1.8.0\bin;C:\Program Files\pl\bin;C:\Python22 and my python.exe is in C:\Python22
Kasun Kodagoda · 9y ago
Formatted the code.
zorze · 8y ago
stackoverflow.com/questions/47952935/… Only this worked for me!