From 521be1eda0e28f3ca866a4faf75c72cd834de418 Mon Sep 17 00:00:00 2001 From: Angus Date: Tue, 3 Sep 2024 08:52:57 +0100 Subject: [PATCH] switch python command according to os --- a00_qpip/plugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/a00_qpip/plugin.py b/a00_qpip/plugin.py index 837c66c..3b735b9 100644 --- a/a00_qpip/plugin.py +++ b/a00_qpip/plugin.py @@ -251,9 +251,13 @@ def pip_install_reqs(self, reqs_to_install): os.makedirs(self.prefix_path, exist_ok=True) log(f"Will pip install {reqs_to_install}") + # python is normally found at sys.executable, but there is a bug on windows qgis so use 'python' instead + # https://github.com/qgis/QGIS/issues/45646 + python_command = 'python' if os.name == 'nt' else sys.executable + run_cmd( [ - sys.executable, + python_command, "-um", "pip", "install",