Windows Python 启动器 (py.exe) 如何找到 python 可执行文件?

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

我第一次尝试使用 Windows Python 启动器 (py.exe)。我在命令 shell 中运行 python,但在同一 shell 中运行的启动器找不到任何版本的 python.exe 来运行:

where python                                          
C:\Python38\python.exe                                  
py --list                                             
Installed Pythons found by py Launcher for Windows      
No Installed Pythons Found!  

                       

显然我的配置中缺少一些东西,但我不知道是什么。我一直在深入研究注册表并在以下位置找到了钥匙:

HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Python/PyLauncher   
HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Python/PythonCore

但没有任何内容引用任何可执行文件。

任何帮助表示赞赏!

python windows launcher
1个回答
2
投票

你走在正确的道路上。对于您的情况,您需要在注册表中添加以下条目:

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.8]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.8\InstallPath]
@="C:\\python38\\"
"ExecutablePath"="C:\\Python38\\python.exe"
"WindowedExecutablePath"="C:\\Python38\\pythonw.exe"

也在 py launcher does not find my Python 2.7

中回答
© www.soinside.com 2019 - 2024. All rights reserved.