关闭 Python 的管理应用程序执行别名
预计阅读时间:5分钟
- 在Windows 10或11 上,单击“开始”按钮或“搜索”图标。
- 键入 –管理应用程序执行别名 以搜索此 Windows 功能。
- 很快您就会在搜索结果中看到它;点击它。

- 向下滚动并找到“ Python3 ”和“ Python ”App Installer 选项。
- 要阻止 Python 命令打开 Microsoft 商店,请关闭它们前面的切换按钮。

- 现在,关闭您的 CMD 终端或 Powershell 并再次重新打开它。
- 键入
python
命令以检查它是否已停止重定向到MS Store。

注意:如果你得到’ python ‘ is not recognized as an internal or external command, operable program , or batch file 错误,那么你必须手动将你的Python安装目录位置路径添加到系统环境变量中。
- 转到 Windows 11 或 10 搜索
- 键入系统变量,然后单击“编辑系统环境变量”选项。

- 系统属性将打开;单击“环境变量”按钮。

- 单击编辑,然后单击新建。之后,点击浏览按钮找到你安装的Python文件夹:

注意– 可以在AppData目录下找到手动安装的 Python 文件的典型路径。它在您的用户文件夹中;默认情况下,它是隐藏的,所以不要忘记更改文件属性。使用 Windows 系统中的用户名更改您的用户,而Python311是版本并且在您的情况下可能会有所不同。
C:\Users\your-user\AppData\Local\Programs\Python\Python311\Scripts\
常问问题
为什么 Python 打开 Windows 应用商店?
每当我们在 PowerShell 或 CMD 中输入Python时,它会自动打开 Windows 微软商店,帮助新用户轻松安装 Python 稳定版。但是,这意味着如果您打算手动安装此编程语言,则必须关闭 Python 添加的从 App Execution Aliases 到 Store 的快捷方式。
如何在 Windows 中打开 Python shell?
安装 Python 后,转到 Windows 搜索并键入 python。这将显示带有徽标的应用程序以打开 Python 的 Shell。或者,用户可以在 CMS 或 PowerShell 上运行命令python
。

为什么我的 Python 没有在 cmd 中打开?
它没有在 CMD 中打开,因为您的系统上没有安装 Python,或者它的目录路径没有添加到系统环境变量帐户中。