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:
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!
After turning off these two B, my cmd can be opened with python. and yours
Reason (knowledge supplement):
- 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.
- 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.
Reference
- https://stackoverflow.com/questions/58754860/cmd-opens-windows-store-when-i-type-python
- http://t.csdn.cn/2oWaq
that's all.