MCPcopy Create free account
hub / github.com/Surfer-Org/Protocol / installDependencies

Method installDependencies

desktop/src/main/helpers/python.ts:413–435  ·  view source on GitHub ↗
(dataFolderPath: string)

Source from the content-addressed store, hash-verified

411 }
412
413 private async installDependencies(dataFolderPath: string) {
414 if (!this.SurferPythonPath) {
415 throw new Error('Python path is not set. Cannot install dependencies.');
416 }
417
418 const pythonPath = `"${this.SurferPythonPath}"`;
419 const pipCommand = `${pythonPath} -m pip`;
420
421 const commands = [
422 `${pipCommand} install --upgrade pip`,
423 `${pipCommand} install -r "${path.join(dataFolderPath, 'requirements.txt')}"`,
424 ];
425
426 for (const command of commands) {
427 console.log(`Executing: ${command}`);
428 try {
429 await execAsync(command, { shell: true });
430 } catch (error) {
431 console.error(`Error executing command: ${command}`, error);
432 throw error;
433 }
434 }
435 }
436
437 private async runCommand(command: string, args: string[]): Promise<void> {
438 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected