6

I am trying to alias for Python in my ~/.bashrc file. I am entering this command to tell Git Bash where to find the Python executable file:

python --version winpty

...from within my [Git Bash] and unfortunately, I am getting this error:

MINGW64 ~
$ python --version
winpty: error: cannot start '"C:/Program Files/WindowsApps/Microsoft.DesktopAppInstaller_1.4.3161.0_x64__8wekyb3d8bbwe/AppInstallerPythonRedirector.exe" --version': Access is denied. (error 0x5)

How should I run python from the [Git Bash] properly?

Thank you.

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
Jack
  • 101
  • 1
  • 8
  • 1
    You should change App Installers of python.exe and python3.exe as *off* from Settings/Apps/App Execution Aliases. I faced same error and it resolved. You can also check the link for detailed explanation. https://stackoverflow.com/a/57168165/15658588 Thanks to @notanumber – Gamze Jun 24 '21 at 13:53
  • I saw this error too. Try following my instructions here: [Python doesn't work in Git Bash (it just hangs or freezes forever); and getting Linux hash-bangs to work in Windows](https://stackoverflow.com/a/76918262/4561887) – Gabriel Staples Aug 17 '23 at 03:30

1 Answers1

2

Search for "App execution aliases" in Windows and make sure Appl Installer for python.exe is turned off.

Sample Screenshot

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 29 '21 at 08:05