diff --git a/src/utils/setup/setupPipPack.ts b/src/utils/setup/setupPipPack.ts index 43b86b0e..508ebbd7 100644 --- a/src/utils/setup/setupPipPack.ts +++ b/src/utils/setup/setupPipPack.ts @@ -4,6 +4,7 @@ import which from "which" import { addPath, info } from "@actions/core" import { setupPython } from "../../python/python" import { isBinUptoDate } from "./version" +import { join } from "path" let pip: string | undefined @@ -34,7 +35,11 @@ export async function setupPipPack(name: string, version?: string) { } else if (process.platform === "darwin") { binDir = "/usr/local/bin/" } else { - binDir = (await getExecOutput("python -c 'import sys\nprint(sys.base_exec_prefix)'")).stdout + try { + binDir = join((await getExecOutput('python3 -c "import sys;print(sys.base_exec_prefix);"')).stdout, "Scripts") + } catch { + binDir = join((await getExecOutput('python -c "import sys;print(sys.base_exec_prefix);"')).stdout, "Scripts") + } } info(`${binDir} to PATH`) addPath(binDir)