“python --version”即使在安装并将路径添加到环境变量后也不起作用

问题描述 投票:0回答:2

在 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\

python path stable-diffusion
2个回答
0
投票

由于我的电脑上有 2 个用户配置文件,尽管它们都拥有完整的管理员权限,但它看起来似乎在处理路径变量。我在我的主配置文件上安装了 python,它解决了这个问题。


0
投票

安装后,重新启动电脑。如果问题仍然存在:

  1. 使用安装时使用的相同 exe 文件卸载 python
  2. 使用相同的文件重新安装,点击exe文件后,你会看到一个复选框“Add Python to Path”
  3. 选择并完成安装
  4. 重新启动电脑
  5. 享受吧!
© www.soinside.com 2019 - 2024. All rights reserved.