MCPcopy Create free account
hub / github.com/6174/comflowyspace / installPipPackageTask

Function installPipPackageTask

apps/node/src/modules/comfyui/bootstrap.ts:258–287  ·  view source on GitHub ↗
(dispatcher: TaskEventDispatcher, params: {
    packageRequirment: string
})

Source from the content-addressed store, hash-verified

256 * @returns
257 */
258export async function installPipPackageTask(dispatcher: TaskEventDispatcher, params: {
259 packageRequirment: string
260}): Promise<boolean> {
261 const { PIP_PATH, PYTHON_PATH } = conda.getCondaPaths();
262
263 let success = false;
264 let lastError = null;
265
266 for (let i = 0; i < 3; i++) {
267 try {
268 dispatcher({
269 message: `Pip install ${params.packageRequirment}...`
270 });
271 await runCommand(`${PIP_PATH} install ${params.packageRequirment}`, dispatcher);
272 dispatcher({
273 message: `Install ${params.packageRequirment} end`
274 });
275 success = true;
276 break;
277 } catch (e: any) {
278 lastError = e
279 }
280 }
281
282 if (!success) {
283 new Error(`Install conda packages error: ${lastError.message}`)
284 }
285
286 return true;
287}
288
289
290/**

Callers

nothing calls this directly

Calls 2

runCommandFunction · 0.90
getCondaPathsMethod · 0.80

Tested by

no test coverage detected