在 cmd 中输入“python --version”时,出现以下错误:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
“py --version”有效,但我需要它与“python”命令而不是“py”一起使用,因为稳定扩散使用“python”来执行脚本
这是我的Python安装位置:
C:\Users\Ruben Work\AppData\Local\Programs\Python\Python310
我已将以下内容添加到用户和系统的“路径”变量中:
C:\Users\Ruben Work\AppData\Local\Programs\Python\Python310\Scripts
C:\Users\Ruben Work\AppData\Local\Programs\Python\Python310\
由于我的电脑上有 2 个用户配置文件,尽管它们都拥有完整的管理员权限,但它看起来似乎在处理路径变量。我在我的主配置文件上安装了 python,它解决了这个问题。
安装后,重新启动电脑。如果问题仍然存在: