I am calling Python(Anaconda) code from Java using ProcessBuilder. It was working fine when I had installed only Python. But now I have removed Python and installed Anaconda. The code to call Python is not working now. Getting the following error.
com.api.ai.helper.MLPythonAPI callPyhonScriptToPredict
SEVERE: null
java.io.IOException: Cannot run program "python": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.api.ai.helper.MLPythonAPI.callPyhonScriptToPredict(MLPythonAPI.java:66)
I am using python 3.6.1(anaconda3 4.4.0 64 bit) and following code to execute Python
ProcessBuilder pb = new ProcessBuilder().inheritIO().
command("python", "C:\\my_code\\test.py", userSays, filePath);
Process p = pb.start();
p.waitFor();
Can somebody help me in this.