Default to cmd python on Windows
This commit is contained in:
@@ -157,29 +157,11 @@ export async function resolveBasePythonCommand(config: AppConfig): Promise<Pytho
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
const candidates = [
|
return {
|
||||||
{ command: "python", args: [] as string[] },
|
command: "python",
|
||||||
{ command: "py", args: ["-3"] },
|
args: [],
|
||||||
{ command: "py", args: [] as string[] },
|
viaCmdShell: true,
|
||||||
];
|
};
|
||||||
|
|
||||||
for (const candidate of candidates) {
|
|
||||||
const absolute = await resolveWindowsExecutable(candidate.command);
|
|
||||||
if (absolute) {
|
|
||||||
const absoluteViaCmd = shouldUseCmdShell(absolute);
|
|
||||||
if (await canRun(absolute, candidate.args, absoluteViaCmd)) {
|
|
||||||
return { command: absolute, args: candidate.args, viaCmdShell: absoluteViaCmd };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await canRun(candidate.command, candidate.args, true)) {
|
|
||||||
return { ...candidate, viaCmdShell: true };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error(
|
|
||||||
"Windows에서 사용할 Python 실행기를 찾지 못했습니다. `python --version` 또는 `py -3 --version` 이 먼저 동작해야 합니다. 필요하면 .env 에 LOCAL_AI_PYTHON=python 또는 LOCAL_AI_PYTHON=py -3 를 넣으세요.",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const unixCandidates = [
|
const unixCandidates = [
|
||||||
|
|||||||
Reference in New Issue
Block a user