diff --git a/server/.gitignore b/server/.gitignore index 08d7241be..58a4a9c39 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -9,3 +9,4 @@ scrypted.db.bak .exit .update .venv +py diff --git a/server/bin/postinstall b/server/bin/postinstall index c9838b167..0f21f125f 100644 --- a/server/bin/postinstall +++ b/server/bin/postinstall @@ -1,5 +1,6 @@ #!/usr/bin/env node +const path = require('path'); const child_process = require('child_process'); const { PortablePython } = require('@bjia56/portable-python') const { once } = require('events'); @@ -13,7 +14,7 @@ async function pipInstall(pkg) { } async function installScryptedServerRequirements() { - const py = new PortablePython("3.9"); + const py = new PortablePython("3.9", path.join(path.dirname(__dirname), 'py')); await py.install(); python = py.executablePath; diff --git a/server/package-lock.json b/server/package-lock.json index 468ab0036..269b82991 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/server", - "version": "0.94.19", + "version": "0.94.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/server", - "version": "0.94.19", + "version": "0.94.20", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/server/package.json b/server/package.json index d9dc8076d..eb9a8e115 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/server", - "version": "0.94.20", + "version": "0.94.21", "description": "", "dependencies": { "@bjia56/portable-python": "^0.1.3", diff --git a/server/src/plugin/runtime/python-worker.ts b/server/src/plugin/runtime/python-worker.ts index c5f2628fd..c2f06efc2 100644 --- a/server/src/plugin/runtime/python-worker.ts +++ b/server/src/plugin/runtime/python-worker.ts @@ -13,7 +13,7 @@ export class PythonRuntimeWorker extends ChildProcessWorker { static { try { const PortablePython = require('@bjia56/portable-python').PortablePython as typeof PortablePythonType; - const py = new PortablePython("3.9"); + const py = new PortablePython("3.9", path.join(path.dirname(__dirname), '..', '..', 'py')); const portablePython = py.executablePath; if (fs.existsSync(portablePython)) process.env.SCRYPTED_PYTHON_PATH = portablePython;