j
Size: a a a
j
j
SR
SR
SR
j
VB
SR
SR
VB
VB
AR
SR
SR
G
SR
VB
AR
G
f
fn find_python() -> String {
env::var("PYTHON3").ok().unwrap_or_else(|| {
let candidates = if cfg!(windows) {
["python3.8.exe", "python38.exe", "python.exe"]
} else {
["python3.8", "python3", "python"]
};
for &name in &candidates {
if Command::new(name)
.arg("--version")
.output()
.ok()
.map_or(false, |out| out.status.success())
{
return name.to_owned();
}
}
panic!(
"Can't find python (tried {})! Try fixing PATH or setting the PYTHON3 env var",
candidates.join(", ")
)
})
}