Typing “python” on Windows 10 (version 1903) command prompt opens Microsoft store

74

19

This is strange issue I have observed. I installed Active Python 2.7 on Windows 10 (version 1903).

On typing “python” from search, opens the Python 2.7 prompt but when I type from command prompt window, it triggers the Microsoft Store.

Don't know how to fix it and this never happened on previous versions of Windows (RS5, RS4…)

Edit 2: Please suggest the solution to turn this off: either via command prompt or using answer file to get this after unattended installation.

Ac3_DeXt3R

Posted 2019-05-16T12:13:34.043

Reputation: 1 012

May be that was some sort of advertising, py3.7 is in Windows Store. But I'm using it, not an issue. – Biswapriyo – 2019-05-16T12:32:18.203

Are you using python 2.7? if your system doesn't have python 3.x but 2.x, try typing python in cmd prompt, see what happens? – Ac3_DeXt3R – 2019-05-16T12:42:12.760

3What does this command reveal? where python – Biswapriyo – 2019-05-16T13:41:43.407

1Two options: - C:\Python27\python.exe ;

C:\Users\Username\AppData\Local\Microsoft\WindowsApps\python.exe – Ac3_DeXt3R – 2019-05-17T05:16:50.810

You got your answer. The second option does not exist in normal python installation. – Biswapriyo – 2019-05-17T06:13:35.610

but how it is coming like this? In windows 10 RS5, I never saw this behaviour. – Ac3_DeXt3R – 2019-05-17T11:34:55.820

3This was intended behavior. Microsoft added this behavior with 1903 because they recognized developers struggle getting Python installed. I read about this change but I don’t recall where I read it. – Ramhound – 2019-05-30T10:53:34.343

Of note: if you don't have a Microsoft account, triggering the Microsoft Store just launches Edge and gives you an incomprehensible error message. – Adrian McCarthy – 2020-01-09T23:57:20.083

Yes the problem was triggered by the 2 App installer aliases. One way that never fails is using full paths: https://stackoverflow.com/questions/59885771/python3-7-venv-does-not-create-virtual-environment-directory.

– CristiFati – 2020-01-24T13:19:39.267

Answers

97

Fixed it by removing it automatically on the settings page. Under Apps and Features, there are an application execution aliases.

I am running the latest 1903 update.

enter image description here

Update

Posted 2019-05-16T12:13:34.043

Reputation: 1 071

1Please tell me how to do this setting from command prompt. And also through the answer file to get this in unattended installation. – Ac3_DeXt3R – 2019-09-24T08:14:50.680

2Best bet is to have a script to remove the WindowsApps folder from the PATH environment variable. – selbie – 2019-09-25T09:00:24.967

It happened after a major windows update. Thanks for your solution. – Xin – 2019-10-29T10:00:11.047

It works! Thank you so much! – JackLametta – 2019-11-28T10:49:21.593

2Thank you... . This is the kind of thing that makes me HATE windows. I had to go remove it from the path then i got worried i had a virus because i see this 0byte exe thinking wtf... microsoft needs to quit breaking stuff – Tim Baker – 2019-12-14T22:13:37.620

You should definitely not remove the WindowsApps folder from the PATH, you'd be breaking things you haven't even installed yet... – Jaykul – 2020-02-07T05:42:35.937

MS needs to stop with the bloatware – Avril Lavigne – 2020-02-07T14:14:06.330

Though this is a one kind of solution, This can't help me for my query, please check the "Edit 2" in the question. How to get it fixed via "answer file"!!! – Ac3_DeXt3R – 2020-02-13T06:06:19.647

17

Deleting "C:\Users\Username\AppData\Local\Microsoft\WindowsApps\" from the system environment variable, PATH, prevented the Microsoft Store application from launching when I typed python.exe and python3.exe in a command prompt.

The folder WindowsApps within AppData has a bunch of executables that, if typed in a command prompt, such as iTunes or python would launch the Microsoft Store application allowing the user to download the Python or iTunes UWP application. Once this path is removed from the system variable, typing python.exe or python3.exe, will not launch the Microsoft Store.

This may sound dangerous but if you look in the folder, it has a bunch of exes that, as I said before that would redirect you to download Python from the Microsoft Store. If for example, you type in iTunes in the command prompt, it would redirect you to download iTunes from the Microsoft Store.

Picture of the WindowsApps folder

These executables are built for the user's convenience and are not necessary tools for Windows to work.

Tushar Gautam

Posted 2019-05-16T12:13:34.043

Reputation: 171

Welcome to Super User! Can you please explain what that does? – CaldeiraG – 2019-05-30T08:57:50.547

Sounds like this could have some undesired side-effects. – Daniel K – 2019-05-30T10:23:37.000

there were python.exe and python37.exe(i have python3.7) files that were being called by system when I typed "python" in cmd, which in turn was opening Microsoft store to download python distribution. I tried deleting those files but Windows 10 would not let me. So i delete that folder's path from System variables. So , now the actual python.exe(the one that I installed with python distro) is called when I call it in cmd. – Tushar Gautam – 2019-05-30T10:33:24.757

1@DanielK There can be side effects but in my case, there was only one additional file(other that python.exe opening microsoft store) that was debian.exe(this starts wsl debian). I can also start wsl using "wsl" or "bash" keyword and also "debian" keyword is also still working in cmd. So I did not see any side effects so far. I think that folder has mostly redundant files. – Tushar Gautam – 2019-05-30T10:38:44.740

2Moving the path to the end may be better than removing it – phuclv – 2019-06-08T06:40:35.623

This didn't work for me -- even after removing from PATH, the Microsoft store still opened whenever I typed python in cmd. What did work for me was going to "Manage app execution aliases" in Apps & Features, then unticking the "python.exe" App Installer box. – Asker – 2019-07-31T01:53:40.263

5

As @Ramhound mentioned in a previous answer, this is an intentional change as announced in the article: Who put Python in the Windows 10 May 2019 Update?

The article describes the team's intent to make the process easiest for users new to Python:

If you’re already a Python expert with complex needs, you probably know how to install and use it. It’s much more likely that someone will hit this problem the first time they are trying to use Python. Many of the teachers we spoke to confirmed this hypothesis – students encounter this far more often than experienced developers.

So we made things easier.

I could not find a full list of features from 1903 on the microsoft site, but PureInfoTech provides a great comprehensive list of the new features

Not mentioned in the article, it also accompanies some new layout changes and features updates, such as in the Apps & Features in settings:

In settings, select Apps & Features, then you should see a new option 'App execution aliases' which will have python.exe and python3.exe

Turning the switch for each App execution alias either deletes or replaces that alias in the directory: <user dir>\appdata\local\microsoft\windowsapps It's also worth noting that if you have the update and python.exe or any of the aliases don't work for you, you may have to turn them off and on again, which I was able to do when python.exe was not available after the update.

Matt Jecha

Posted 2019-05-16T12:13:34.043

Reputation: 59

4

On typing python from Search, opens the python 2.7 prompt but when I type from command prompt window, it triggers Microsoft Store.

Don't know how to fix it. This never happened on previous versions of windows (RS5, RS4...)

This is intended behavior on Windows 10 version 1903. There isn’t anything to fix.

While Python continues to remain completely independent from the operating system, every install of Windows will include python and python3 commands that take you directly to the Python store page. We believe that the Microsoft Store package is perfect for users starting out with Python, and given our experience with and participation in the Python community we are pleased to endorse it as the default choice.

Source: Who put Python in the Windows 10 May 2019 Update?

Ramhound

Posted 2019-05-16T12:13:34.043

Reputation: 28 517

0

I'm posting this in addition to the other answers in case anyone else encounters this frustration to the extent that I did.

I had Python 3 in my PATH before the 1903 update, and the 1903 update still added those two "rogue" python files in my WindowsApps folder. Even after removing that folder from my user PATH (it wasn't in my system PATH), and after rebooting, typing "python" in PowerShell opened the store. The WindowsApps folder was at the end of my PATH variable anyways, so it should not have overridden the working version, but it did. Get-Command python even returned the python.exe in WindowsApps.

The only way I could get it to run the version of Python I had working previously was to delete those python files from the WindowsApps folder; apparently PowerShell implicitly looks in that folder instead of using the PATH variable if those files are present.

Arcanox

Posted 2019-05-16T12:13:34.043

Reputation: 119

How do I rename these files. They are 0 bytes in size? Also opened cmd terminal as admin. Not able to remove :( – Rudiger Wolf – 2019-08-03T17:51:56.160

Deleted python3.7 and then installed python3.8 followed by python3.7. That sorted out running python from the powershell terminal. – Rudiger Wolf – 2019-08-03T19:41:10.217

0

I ran into this problem recently. With Visual Studio 2019 installed, I had already installed Python as a workload. I went to CMD and typed python. Up came the Microsoft Store. After wasting too much time looking more into this, it was obvious to me Microsoft Visual Studio team and Python team were not on the same page.

What I eventually ended up with was going back into Visual Studio installer and unchecking the Python workload to uninstall. Then, going into Windows Apps and uninstalling Python and any Python related applications listed.

After noticing that Python was installed on my 1TB NVMe SSD boot drive in the users directory I cringed. The path name was not friendly at all. Not only that, but because I have limited space on that drive and with all the Microsoft Store apps piling up, I dread to think what happens when the drive goes full.

So I decided, this was not good and chose to go to the Python website and download the current version. Then, install in a non-boot drive with plenty of disk space into a friendlier file path (D:\Python). You'll see why this is important when you go pip down a bunch of packages and applications...

Also, if you run into environment space problems, at the end of the Python installer is a question if you want to increase environment space. Say yes. Looking at my environment PATH, D:\Python\Python38\Scripts and D:\Python\Python38 were pre-appended.

Kerry Kobashi

Posted 2019-05-16T12:13:34.043

Reputation: 111

-2

You can put your python installation folder before C:\Users\<Username>\AppData\Local\Microsoft\WindowsApps\ in the Path environment variable. Such as enter image description here

Nathan Xabedi

Posted 2019-05-16T12:13:34.043

Reputation: 99

This is not related to path at all. I have tried this but doesn't work. – Ac3_DeXt3R – 2020-02-24T12:40:58.330