From 1f59ba33f106a4c39a05a9d8e39a5846d9131fa4 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 1 Sep 2023 02:36:39 -0700 Subject: [PATCH] fix: use user flag when installing packages via pip --- src/utils/setup/setupPipPack.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/setup/setupPipPack.ts b/src/utils/setup/setupPipPack.ts index f3c3e569..a2f55f9d 100644 --- a/src/utils/setup/setupPipPack.ts +++ b/src/utils/setup/setupPipPack.ts @@ -20,13 +20,15 @@ export async function setupPipPackWithPython( name: string, version?: string, upgrade = false, + user = true, ): Promise { info(`Installing ${name} ${version ?? ""} via pip`) const nameAndVersion = version !== undefined && version !== "" ? `${name}==${version}` : name const upgradeFlag = upgrade === true ? ["--upgrade"] : [] + const userFlag = user === true ? ["--user"] : [] - execaSync(givenPython, ["-m", "pip", "install", ...upgradeFlag, nameAndVersion], { + execaSync(givenPython, ["-m", "pip", "install", ...upgradeFlag, ...userFlag, nameAndVersion], { stdio: "inherit", })