From f514fe6c119808c7b16b844918857b0f382b5c54 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 11 Oct 2024 19:46:36 +0530 Subject: [PATCH] Different way to use python path in dev shell --- scripts/webui_console.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/webui_console.py b/scripts/webui_console.py index 106788f4..6274e1df 100644 --- a/scripts/webui_console.py +++ b/scripts/webui_console.py @@ -54,6 +54,18 @@ def configure_env(dir): def print_env_info(): which_cmd = "where" if platform.system() == "Windows" else "which" + python = "python" + + def locate_python(): + nonlocal python + + python = subprocess.getoutput(f"{which_cmd} python") + python = python.split("\n") + python = python[0].strip() + print("python: ", python) + + locate_python() + def run(cmd): with subprocess.Popen(cmd) as p: p.wait() @@ -61,7 +73,7 @@ def print_env_info(): run([which_cmd, "git"]) run(["git", "--version"]) run([which_cmd, "python"]) - run(["python", "--version"]) + run([python, "--version"]) print(f"PATH={os.environ['PATH']}")