diff --git a/src/main/install-manager.ts b/src/main/install-manager.ts index 69cd4fc..7e2ecc5 100644 --- a/src/main/install-manager.ts +++ b/src/main/install-manager.ts @@ -311,6 +311,10 @@ export class InstallManager { installInvokeArgs.push(`--index=${torchIndexUrl}`); } + // Manually set the VIRTUAL_ENV environment variable to the venv path to ensure `uv` uses it correctly. + // Unfortunately there is no way to specify this in the `uv` CLI. + runProcessOptions.env.VIRTUAL_ENV = venvPath; + this.log.info('Installing invokeai package...\r\n'); this.log.info(`> ${uvPath} ${installInvokeArgs.join(' ')}\r\n`);