From 1b18cb443c9e60a20ffb3f50775936d66f58fec1 Mon Sep 17 00:00:00 2001 From: romainGuiet Date: Wed, 2 Oct 2024 18:14:32 +0200 Subject: [PATCH] remove unnecessary cmd.exe /C and actually adding the list of arguments so it can work with venv !!! --- .../java/ch/epfl/biop/wrappers/ExecutePythonInConda.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/epfl/biop/wrappers/ExecutePythonInConda.java b/src/main/java/ch/epfl/biop/wrappers/ExecutePythonInConda.java index 06db8a6..78c8359 100644 --- a/src/main/java/ch/epfl/biop/wrappers/ExecutePythonInConda.java +++ b/src/main/java/ch/epfl/biop/wrappers/ExecutePythonInConda.java @@ -73,8 +73,12 @@ public static void execute(String envDirPath, String envType, List argum } else if (envType.equals("venv")) { // venv if (IJ.isWindows()) { - List venv_activate_cmd = Arrays.asList("cmd.exe", "/C", new File(envDirPath, "Scripts/activate").toString()); + List venv_activate_cmd = Arrays.asList(new File(envDirPath, "Scripts/activate").toString()); cmd.addAll(venv_activate_cmd); + cmd.add("&");// to have a second command + List module_args_cmd = Arrays.asList("python", "-Xutf8"); + cmd.addAll(module_args_cmd); + cmd.addAll(arguments); } else if (IJ.isMacOSX() || IJ.isLinux()) { throw new UnsupportedOperationException("Mac/Unix not supported yet with virtual environment. Please try conda instead."); }