diff options
| author | yum <yum.food.vr@gmail.com> | 2025-07-24 16:23:42 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-07-24 16:33:19 -0700 |
| commit | dcafd889462c8c3725273d70951194f3032e06cd (patch) | |
| tree | bb2d4088fe7fe3d333a671f117db1ee1c0d12ca3 | |
| parent | 03d46a5085fa003df27843755a009f603454778d (diff) | |
Clean up python process environment
| -rw-r--r-- | ui/index.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/index.js b/ui/index.js index 63c633a..e11e3aa 100644 --- a/ui/index.js +++ b/ui/index.js @@ -48,9 +48,9 @@ function sendPythonOutput(message, type = 'stdout') { // Helper function to create environment with DLL path function createPythonEnvironment() { const dllPath = path.join(APP_ROOT, 'dll'); - const binPath = path.join(APP_ROOT, 'bin'); - const env = { ...process.env }; - env.PATH = `${dllPath};${binPath};${env.PATH}`; + const binPath = path.join(APP_ROOT, 'venv', 'Scripts'); + const env = {}; + env.PATH = `${dllPath};${binPath}`; env.HF_HUB_DISABLE_SYMLINKS_WARNING = '1'; return env; } @@ -150,7 +150,7 @@ function setupProcessHandlers(process) { function executePythonCommand(args, options = {}) { return new Promise((resolve, reject) => { const pythonPath = getVenvPython(); - const commandStr = `${path.basename(pythonPath)} ${args.join(' ')}`; + const commandStr = `${pythonPath} ${args.join(' ')}`; sendPythonOutput(`> ${commandStr}`, 'info'); const spawnOptions = { @@ -399,7 +399,9 @@ ipcMain.handle('install-requirements', async () => { if (error.code === 'ENOENT') { throw new Error('requirements.txt not found'); } - throw new Error(`Installation failed: ${error.stderr || error.error || 'Unknown error'}`); + + const errorDetails = error.stderr || error.stdout || error.message || error.error || 'Unknown error'; + throw new Error(`Installation failed: ${errorDetails}`); } }); |
