Managing Python aliases on Windows
Python was not found but can be installed from the Microsoft Store: ...
I kept getting the above error when calling Python in the command-line after upgrading Python, despite adding it to System Environment Variables. As it turns out, Windows secretly maintains aliases - python.exe & python3.exe - in ‘%USERPROFILE%\AppData\Local\Microsoft\WindowsApps’ that encourages Python installations through its Microsoft Store. While this may streamline the installation process for new users, this causes rage to those that want more bespoke configurations.
Thankfully, one can easily disable these aliases once they are made aware of them.
Step 1: Locate the aliases
Search ‘Manage App Execution Aliases’ in the Windows search bar.
Step 2: Toggle off ‘python.exe’ & ‘python3.exe’
A further step is to put ‘%USERPROFILE%\AppData\Local\Microsoft\WindowsApps’ lower in the pecking order in Environment Variables.