From 31b424f89f4576004dfb4d6e3dc3a9444dc0715a Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 25 Mar 2023 21:52:32 -0700 Subject: [PATCH] server: mac python fixes --- server/.vscode/launch.json | 4 +++- server/package-lock.json | 4 ++-- server/src/plugin/runtime/python-worker.ts | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/server/.vscode/launch.json b/server/.vscode/launch.json index a55e26448..4ea9286b7 100644 --- a/server/.vscode/launch.json +++ b/server/.vscode/launch.json @@ -27,7 +27,9 @@ "${workspaceFolder}/**/*.js" ], "env": { - "SCRYPTED_PYTHON_PATH": "python3.10", + // force usage of system python because brew python is 3.11 + // which has no wheels for coreml tools or tflite-runtime + "SCRYPTED_PYTHON_PATH": "/usr/bin/python3", // "SCRYPTED_SHARED_WORKER": "true", // "SCRYPTED_DISABLE_AUTHENTICATION": "true", // "DEBUG": "*", diff --git a/server/package-lock.json b/server/package-lock.json index dd466d406..530d27d3d 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/server", - "version": "0.7.31", + "version": "0.7.32", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/server", - "version": "0.7.31", + "version": "0.7.32", "license": "ISC", "dependencies": { "@mapbox/node-pre-gyp": "^1.0.10", diff --git a/server/src/plugin/runtime/python-worker.ts b/server/src/plugin/runtime/python-worker.ts index e6b21c6c0..3dbb9c08a 100644 --- a/server/src/plugin/runtime/python-worker.ts +++ b/server/src/plugin/runtime/python-worker.ts @@ -39,7 +39,10 @@ export class PythonRuntimeWorker extends ChildProcessWorker { '/usr/local/lib/gstreamer-1.0', ]; for (const gstPath of gstPaths) { - if (fs.existsSync(path.join(gstPath, 'libgstx264.dylib'))) { + // search for common plugins. + if (fs.existsSync(path.join(gstPath, 'libgstx264.dylib')) + || fs.existsSync(path.join(gstPath, 'libgstlibav.dylib')) + || fs.existsSync(path.join(gstPath, 'libgstvideotestsrc.dylib'))) { gstEnv['GST_PLUGIN_PATH'] = gstPath; break; }