Home > Backend Development > Python Tutorial > Why Is CMD Redirecting to the Windows Store When I Enter 'Python'?

Why Is CMD Redirecting to the Windows Store When I Enter 'Python'?

DDD
Release: 2024-11-23 19:29:11
Original
322 people have browsed it

Why Is CMD Redirecting to the Windows Store When I Enter 'Python'?

CMD Redirects to Windows Store When Entering 'Python': A Detailed Explanation and Resolution

When attempting to run Python code in Sublime Text 3, the unexpected message, "Python was not found but can be installed from the Microsoft Store," may appear, followed by CMD redirecting you to the Windows Store to download Python 3.7. This issue can arise seemingly without cause and despite correct Path environment variable settings.

Solution: Using Windows Settings to Remove Python Execution Aliases

To resolve this problem, navigate to the Windows search bar and search for "Manage app execution aliases." You will likely find two aliases for Python. Uncheck these aliases, allowing the standard "python" and "python3" aliases to be used.

Explanation of the Issue

This problem originates from the installation of Python after a fresh Windows installation. During setup, Windows creates aliases named python.exe and python3.exe in %USERPROFILE%AppDataLocalMicrosoftWindowsApps. These aliases are placed at the beginning of the "Path" environment variable list.

When entering "python" in CMD, the directories listed in the "Path" are searched from top to bottom. If Python was installed after a new Windows installation, the alias files will be found first, leading to the redirection to the Windows Store.

Additional Solution Options

If the previous solution does not resolve the issue, you can consider creating a new alias for Python using DOSKEY. Alternatively, you could delete the Windows user path environment variable that points to the alias files, although this may disrupt other applications that rely on execution aliases in that directory.

The above is the detailed content of Why Is CMD Redirecting to the Windows Store When I Enter 'Python'?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template