这篇文章记录了从环境变量冲突、应用执行别名干扰,到手动配置 python3 别名的完整排查过程。如果你也在 Windows 下使用 uv 或遇到了类似的“Python not found”问题,希望这篇教程能帮你节省时间。
⚠️ 初次尝试:Python 找不到?
最开始,我直接复制了官方提供的安装命令运行,结果终端立刻抛出了错误:
$ curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
PS C:\Users\Azrng> python -v Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings -> App execution aliases.
🔍 环境分析:uv 的目录结构
先来看看当前的系统环境变量(PATH)配置情况:
D:\Soft\pyuv C:\Users\Azrng\AppData\Local\Microsoft\WindowsApps D:\Program Files\Microsoft VS Code\bin
Azrng@AZRNG MINGW64 /d $ curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings -> App execution aliases.
🛡️ 解决方案二:禁用 App Execution Aliases
Windows 系统有一个“应用执行别名”功能,它会拦截 python.exe 的调用。为了彻底避免干扰,建议将其关闭。
操作步骤:
1. 打开 Windows 设置 → 应用 → 高级应用设置 → 应用执行别名。
2. 找到 python.exe 和 python3.exe,将开关关闭。
img
🔄 解决方案三:解决 python3 依赖问题
关掉别名后,再次运行安装脚本,虽然不再提示之前错误了,但出现了新的错误:
Azrng@AZRNG MINGW64 /d/Soft/pyuv $ curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash Error: python3 is required for skillhub. Azrng@AZRNG MINGW64 /d/Soft/pyuv $ where python3 信息: 用提供的模式无法找到文件。 Azrng@AZRNG MINGW64 /d/Soft/pyuv $ where python C:\Users\Azrng\AppData\Roaming\uv\python\cpython-3.13.9-windows-x86_64-none\python.exe