首页 > 解决方案 > 无法在 Windows 10“权限被拒绝”上运行 Python 3.7

问题描述

当尝试使用 Git Bash 在 Windows 10 上运行 Python 3.7 时,我收到以下错误:

$ python --version
bash: /c/Users/Name/AppData/Local/Microsoft/WindowsApps/python: Permission denied

该怎么办?

编辑:我通过使用 scoop 安装 python 并使用 cmder 而不是 Git Bash 解决了(或者更确切地说是规避了)这个问题。

标签: pythonwindowsbashgit

解决方案


Python 并未实际安装。这是一个应该打开 Windows 应用商店的 shim,但它只能在 PowerShell 或 CMD 中运行(并且有时只能正确运行)。我建议访问 Python 网站并从那里下载和安装。

这是宣布此“功能”的博客文章:https ://devblogs.microsoft.com/python/python-in-the-windows-10-may-2019-update/

这篇超级用户文章讨论了解决方案: https ://superuser.com/questions/1437590/typing-python-on-windows-10-version-1903-command-prompt-opens-microsoft-stor


推荐阅读