简体   繁体   English

权限被拒绝错误:Windows Gitbash 上的 Python 3.8

[英]Permission Denied error: Python 3.8 on Windows Gitbash

New to Python. Python 新手。 I get the following error on doing a python --version on my GitBash.在我的 GitBash 上执行python --version时出现以下错误。 ...Appdata/Local/Microsoft/WindowsApps/python3: Permission Denied ...Appdata/Local/Microsoft/WindowsApps/python3:权限被拒绝

Based on some answers on this forum I turned off the App execution aliases for python.根据这个论坛上的一些答案,我关闭了 python 的应用程序执行别名。 Doing this deleted the two "stubs" python.exe and python3.exe from my Windows App folder and resulted in another error of No such file or directory to my python --version on GitBash.这样做从我的 Windows 应用程序文件夹中删除了两个“存根”python.exe 和 python3.exe,并导致另一个错误 No such file or directory to my python --version on GitBash。

I am a novice to python so it gets annoying to be stuck at the installation itself.我是 python 的新手,所以被困在安装本身会很烦人。 What am I missing here ???我在这里错过了什么???

It's December and all these updates from Microsoft I assume has still not fixed this issue.现在是 12 月,我认为微软的所有这些更新仍然没有解决这个问题。 Or?或者?

To fix this Problem you need to install the required Python-Windows-Version (In my case it was 3.9).要解决此问题,您需要安装所需的 Python-Windows-Version(在我的情况下是 3.9)。 Then you search for Edit environment variables for your account in the startmenu.然后在开始Edit environment variables for your account搜索Edit environment variables for your account Open up the PATH -Variable and move the PATH for %USERPROFILE%\\AppData\\Local\\Microsoft\\WindowsApps below the PATH of your Python-Installation.打开PATH -Variable 并将%USERPROFILE%\\AppData\\Local\\Microsoft\\WindowsApps的 PATH 移动到 Python 安装的 PATH 下方。

此图显示了编辑后的 ​​PATH 变量

Now you enter manage app execution aliases into the windows search and deactivate the 2 Entrys for python there.现在,您将manage app execution aliases输入到 Windows 搜索中,并在那里停用 Python 的 2 个条目。

此图显示了设置 -> 应用执行别名中停用的 python*.exe 文件

The last thing you need to do is to open your Python-Installation-Folder.您需要做的最后一件事是打开 Python-Installation-Folder。 This folder is usually at %USERPROFILE%\\AppData\\Local\\Programs\\Python\\Python39 (If you're using Python 3.9) Don't forget to change the path to your Python-version (eg Python38).该文件夹通常位于%USERPROFILE%\\AppData\\Local\\Programs\\Python\\Python39 (如果您使用的是 Python 3.9) 不要忘记更改 Python 版本的路径(例如 Python38)。

Copy the file python.exe in the same directory and rename the copy to python3.exe .将文件python.exe复制到同一目录中,并将副本重命名为python3.exe So you have both python.exe and python3.exe in the installation-folder.所以你在安装文件夹中有python.exepython3.exe

此图显示了python安装文件夹中复制的python3.exe

You can find a similar solution to this problem here您可以在此处找到此问题的类似解决方案

Solved: Python commands won't work on mintty.已解决:Python 命令在 mintty 上不起作用。 I did a python -i to enter the python mode Another option is to do a 'winpty python.exe'我做了一个python -i进入python模式另一个选择是做一个'winpty python.exe'

simply uninstall the old one and install the new one you just downloaded.只需卸载旧的并安装您刚刚下载的新的。 git team has already solved the issue is the last option when installing just check it to use it with python and other programs. git 团队已经解决了这个问题是安装时的最后一个选项,只需检查它以与 python 和其他程序一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM