Python executable in spring boot problem

public symptoms postMethodName(@RequestBody symptoms inputData) throws IOException, InterruptedException{

    // Build the command to call the Python script
    String pythonPath = System.getenv("PYTHON_PATH");
    ProcessBuilder pb = new ProcessBuilder(pythonPath, "src\\main\\python\\prediction_script.py", inputData.getSymList());
    pb.redirectErrorStream(true);

    // Start the Python script
    Process p = pb.start();
    p.waitFor();

in this above code what will be the value of PYTHON_PATH so that i can run python executable in springboot application …

Hi,

If you’re using Spring Boot on Render, then you’ll be using Docker.

With Docker you’re in control of the environment, so you can configure it how you want. You’ll need to ensure Python is installed as part of your Docker build and then set the PYTHON_PATH environment variable as you require.

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.