Python/python3 executes in Command Prompt, but does not run correctly

前端 未结 3 1009
余生分开走
余生分开走 2021-02-19 10:06

I\'ve solved the issue and am posting to save others from my hours of pain.

Problem

On Windows 10,

Python is installed in C:\\Python and a

相关标签:
3条回答
  • 2021-02-19 10:30

    Putting this Q/A into the right format so the question does not look open/unanswered

    Solution from original poster; tested and worked on my system

    Solution

    In C:\Users\*Username*\AppData\Local\Microsoft\WindowsApps delete python.exe. However, because these files are protected, chances are you will get an error message when trying to delete the file. In that case, you either have to use your administrator account to delete python.exe, or you call a cmd-window with administrator privileges and force delete ''''rm -f C:\Users*Username*\AppData\Local\Microsoft\WindowsApps\python.exe''''

    About the solution

    python.exe is not the python - executable one would believe it to be, but invokes the download page for python to be opened in the Edge browser or the Microsoft App Store. The question of "who would come up with such a sadistic thing" and "why?." shall remain unanswered at this point. Fact is that calling python executes this faux- python.exe before the PATH Environment Variables are invoked.

    0 讨论(0)
  • 2021-02-19 10:33

    Just noticed there's an additional python executable in the windowsApp folder too when running where python.

    To remove those you can do it in the App execution aliases in windows setting and uncheck the python aliases.

    Image of the App execution aliases setting here as I am not able to embed picture in answer due to low reputation point

    0 讨论(0)
  • 2021-02-19 10:46

    Here are the screen captures starting with "Start/Settings" in Windows 10, Version 2004, OS build 19041.685, Windows Experience Pack 120.2212.551.0

    0 讨论(0)
提交回复
热议问题