简体   繁体   中英

Permission Denied error: Python 3.8 on Windows Gitbash

New to Python. I get the following error on doing a python --version on my GitBash. ...Appdata/Local/Microsoft/WindowsApps/python3: Permission Denied

Based on some answers on this forum I turned off the App execution aliases for 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.

I am a novice to python so it gets annoying to be stuck at the installation itself. What am I missing here ???

It's December and all these updates from Microsoft I assume has still not fixed this issue. Or?

To fix this Problem you need to install the required Python-Windows-Version (In my case it was 3.9). Then you search for Edit environment variables for your account in the startmenu. Open up the PATH -Variable and move the PATH for %USERPROFILE%\\AppData\\Local\\Microsoft\\WindowsApps below the PATH of your Python-Installation.

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

Now you enter manage app execution aliases into the windows search and deactivate the 2 Entrys for python there.

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

The last thing you need to do is to open your 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).

Copy the file python.exe in the same directory and rename the copy to python3.exe . So you have both python.exe and python3.exe in the installation-folder.

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

You can find a similar solution to this problem here

Solved: Python commands won't work on mintty. I did a python -i to enter the python mode Another option is to do a '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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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