Share via

How to remove python.exe from the WindowsApps directory

Anonymous
2023-09-24T03:58:33+00:00

Split from this thread.

Somehow my user environment is pointing to a python.exe located in my WindowsApps directory, but when I look in my Microsoft Store library and Apps in Settings, it isn't there. I want to remove the python.exe from WindowsApps because I have Python installed elsewhere which I prefer to use, but Windows won't let me delete the file. When I run the file, it takes me to the Microsoft Store to install Python which I don't want to do. It's apparently not actually installed through the Microsoft Store and the python.exe file in WindowsApps is some kind of residual from when I did have Python installed through the Microsoft Store before.

The WindowsApps directory seems to be causing other issues from similar past installs which I have since uninstalled. Why doesn't uninstalling from the Microsoft Store remove all files associated with an application? Is there any way to fix this? Thanks.

Windows for home | Windows 10 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2023-10-25T08:48:25+00:00

    Hi Sintrias,

    I met the same problem as yours. The following steps are how I fixed it.

    I installed python with automatic setting. When I run 'where python' in command line, it showed two directories, one the common directory that has python.exe automatically installed and I want to use in future, but the other is possibly which causes problems. In my case it is 'C:\Users\xxx\AppData\Local\Microsoft\WindowsApps\python.exe'. This one has 0 byte size and always leads you to the Microsoft App Store.

    There are two ways to solve it.

    1. Change the order of 'path' in system environment.

    If your 'Microsoft-relate' python.exe is shown prior to your nomal 'python.exe' when you run 'where python' in cmd, you can just shift the correct directory to be above the incorrect one, so that when you call python in cmd, windows will find the correct position and won't go to Microsoft App Store.

    1. Or you can delete the 'Microsoft-relate' python.exe, by running cmd as administrator, and type in 'cd C:\Users\xxx\AppData\Local\Microsoft\WindowsApps\python.exe', keep in mind xxx here is account name and you need use your own Microsoft directory, and enter.

    Now you are in the working folder. Type in 'del python.exe', and enter. You solve it!

    Yajun

    Was this answer helpful?

    40+ people found this answer helpful.
    0 comments No comments
  2. Ramesh 176.2K Reputation points Volunteer Moderator
    2023-09-24T04:18:07+00:00

    Deleting or editing the user environment variable would be a better idea IMO. I wonder if you've tried that.

    Also, open admin PowerShell and run:

    get-appxpackage *python* -allusers

    Press Enter.

    Please post the output here.

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2024-02-05T05:54:37+00:00

    Deleting or editing the user environment variable would be a better idea IMO. I wonder if you've tried that.

    Also, open admin PowerShell and run:

    get-appxpackage *python* -allusers

    Press Enter.

    Please post the output here.

    It says access is denied

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2024-07-12T14:31:56+00:00

    I did that after opening power shell as administrator and it worked. After that I opened a regular command prompt and wrote python and can confirm the solution worked for me.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments