python 3 After adding environment variables, it is still impossible to use cmd to enter python to access, but the app store pops up | two solutions

Problem Description

After reinstalling python3.10 today, I found that even when the environment variables are added correctly, I still cannot use cmd to enter python or python3 to access, but the app store pops up . But if you enter py in cmd, it can run (proving that python is installed normally).

Here are two solutions. If one method does not work, use both methods, once and for all.

Solution 1

The answer given on the Internet is: because the default store's path environment variable has a higher priority than our configured python directory.
Here is a blog that makes it very clear: insert image description here
I have used the method, but it is useless? ! The python environment variable is set to the top, but cmd still opens the app store. . . .
Then use method 2.

Solution 2

Search for Manage app execution aliases in the start menu

Close App Installer's python.exe and python3.exe!

insert image description here
After turning off these two B, my cmd can be opened with python. and yours

Reason (knowledge supplement):

  1. Windows places an empty or fake file (bad B) named python.exe and python3.exe in a directory named %USERPROFILE%\AppData\Local\Microsoft\WindowsApps.
    As a result, although the order of environment variables is sometimes adjusted, it still cannot be opened with python.

insert image description here

  1. In addition, when running a python program in Sublime Text 3, an error will be reported as shown in the figure below, and a solution will be given.

insert image description here

Reference

  1. https://stackoverflow.com/questions/58754860/cmd-opens-windows-store-when-i-type-python
  2. http://t.csdn.cn/2oWaq

that's all.

Guess you like

Origin blog.csdn.net/qq_41608408/article/details/128597945