// 定位可用的 Python(WindowsApps stub 可能无效)+ 检查 pymysql import { existsSync, readdirSync } from 'node:fs'; const candidates = [ 'E:/python.exe', 'E:/Scripts', 'C:/Python311/python.exe', 'C:/Python312/python.exe', 'C:/Python38/python.exe', 'C:/Users/Administrator/AppData/Local/Programs/Python', 'C:/Program Files/Python311', 'C:/Program Files/Python312', ]; for (const d of candidates) { if (existsSync(d)) { try { console.log('EXISTS ' + d + ' -> ' + readdirSync(d).slice(0, 15).join(' | ')); } catch (e) { console.log('EXISTS ' + d + ' (dir)'); } } else { console.log('MISS ' + d); } }