Home > Article > Backend Development > Why Does CMD Open Windows Store When I Type 'Python'?
CMD Opens Windows Store When Typing 'Python': Solution Revealed
Unable to run Python scripts? When attempting to execute Python code in Sublime Text 3, users encounter an error stating that Python is not found and can be installed from the Microsoft Store. Typing "python" in CMD also redirects them to the Windows Store to download Python 3.7, a baffling issue that has plagued many users.
To solve this dilemma, navigate to the Windows search bar and search for "Manage app execution aliases." You will find two aliases for Python. Unselect them, which will restore the standard "python" and "python3" aliases.
This issue arises when Python is installed on a new Windows system. During the installation process, empty files named "python.exe" and "python3.exe" are placed in the "%USERPROFILE%AppDataLocalMicrosoftWindowsApps" directory. These alias files are prioritized in the "Path" environment variables, resulting in CMD directing users to the Windows Store.
Alternatively, you can use DOSKEY to create a new alias for Python. You can also delete the alias files by navigating to the "%USERPROFILE%AppDataLocalMicrosoftWindowsApps" directory and deleting "python.exe" and "python3.exe." However, this may break other apps that utilize execution aliases.
The App Execution Aliases provide a solution to this issue, allowing users to disable the alias files. This prevents the generation of empty "python.exe" and "python3.exe" files. Microsoft has stated that this system was designed to simplify Python installation for children learning the language in school.
If you encounter this issue, unchecking the App Execution Aliases for "python.exe" and "python3.exe" is the most straightforward solution.
The above is the detailed content of Why Does CMD Open Windows Store When I Type 'Python'?. For more information, please follow other related articles on the PHP Chinese website!