From 0d9d425ef0c0b5c70d4a52563e411b912fe8a3a2 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 22 Dec 2024 12:05:33 -0800 Subject: [PATCH] server: fix python search order --- server/python/plugin_remote.py | 4 ++-- server/src/plugin/runtime/python-worker.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server/python/plugin_remote.py b/server/python/plugin_remote.py index df8a023358..72ac297307 100644 --- a/server/python/plugin_remote.py +++ b/server/python/plugin_remote.py @@ -833,8 +833,8 @@ def read_requirements(filename: str) -> str: print("requirements.txt (up to date)") print(str_requirements) - sys.path.insert(0, plugin_zip_paths.get("unzipped_path")) - sys.path.insert(0, pip_target) + sys.path.append(plugin_zip_paths.get("unzipped_path")) + sys.path.append(pip_target) self.systemManager = SystemManager(self.api, self.systemState) self.deviceManager = DeviceManager(self.nativeIds, self.systemManager) diff --git a/server/src/plugin/runtime/python-worker.ts b/server/src/plugin/runtime/python-worker.ts index 5af12a18be..f1261097c4 100644 --- a/server/src/plugin/runtime/python-worker.ts +++ b/server/src/plugin/runtime/python-worker.ts @@ -46,7 +46,10 @@ export class PythonRuntimeWorker extends ChildProcessWorker { const { env, pluginDebug } = options; const args: string[] = [ + // unbuffered stdout/stderr '-u', + // prevent any global packages from being used + '-S', ]; if (pluginDebug) {