Issue:
When attempting to run Python code in Sublime Text 3, an error message indicates that Python is not found and suggests downloading it from the Microsoft Store. Typing 'python' in CMD prompts the opening of Windows Store to download Python 3.7. This issue has emerged without discernible cause despite reinstalling Python and verifying the correct path environment variable.
Solution:
Modifying App Execution Aliases
Windows aliases place unoccupied or simulated "python.exe" and "python3.exe" files in "%USERPROFILE%AppDataLocalMicrosoftWindowsApps." Following a fresh Windows installation, these aliases are typically enabled, placing the alias directory at the forefront of the "Path" environment variable.
When executing "python" in cmd, the directories listed in "Path" are checked sequentially. If Python is installed after a new Windows 10 installation, the alias python.exe in the App Execution Alias directory will be detected first debido to its high position in "Path."
Disabling the "python.exe" and "python3.exe" aliases eliminates the simulated EXE files and resolves the issue.
The above is the detailed content of Why Does Typing 'python' in CMD Open the Windows Store Instead of Running Python?. For more information, please follow other related articles on the PHP Chinese website!