Hacker News new | ask | show | jobs
by zeta0134 1889 days ago
Just this week, I discovered that even after installing Python from the official website, if you happen to run a script that executes "python3" instead of "python", you'll instead trigger an unhelpful link to the Microsoft Store suggesting to install python from there.

Yes, the command line itself has ads for the store sprinkled throughout it.

Later, when I needed to pull down the Rust compiler, I discovered that the C++ redistributable package, despite not including Visual Studio, helpfully adds an explorer shell link to "Open in Visual Studio" which I suspect is meant to open the Store again, though on my system it appears to do nothing. So that's another ad.

Clearly I'm not the target audience for this kind of stuff, being a Linux administrator and using that as my daily driver, but there's still something inherently creepy about all of this. I don't trust marketers, or the advertising industry at large, and while I understand Microsoft is a business and is necessarily going to engage in some marketing, there's a time and a place. Basic features of my operating system are not it.

5 comments

Even worse, you're paying to be spammed by Windows. This overly-creepy direction Windows is taking is, more than anything else, why I don't trust their recent seeming friendliness to FOSS.

Even Android doesn't get that intrusive, not that it's much better.

if you happen to run a script that executes "python3"

Funny thing is, this is actually wrong on Windows and always has been. Unless I'm missing something. I recently traced back the earliest python3 installer on the official ftp site of python.org and even that one didn't have a python3 command. No official installers seem to have had it. Nor does an Anaconda install. So I don't really know why the 'official' (that is, the one on the MS store) is pushing python3 as a command (apart from 'other OS do have this'). Anyone has any insight on this?

Yes, the command line itself has ads

Technically it's just an executable in the PATH so anything, including any terminal application, which uses that gets it.

helpfully adds an explorer shell link to "Open in Visual Studio

Care to post the link to that installer? Never saw that, curious to see which one that is.

The official Python installer in the Windows App store installs a handler for python and python3 .. or rather, the stub of the handlers already on your system calls into the app store and it's behavior changes after installation. Regardless of the technical implementation, after you install Python3 from the app store, running python3 from the command line will open the Python interpreter.

No clue why the standard non-app store installer doesn't add python3 to the path to mimic this behavior.

The standalone installer is quite old and frankly weird. You're meant to use `py -3` or something like that. I don't know why it works this way. Tbh I think the official store installer works much more sensibly.
Back when I had a large python2 and python3 code bases side by side, I had a small handler that I installed for .py files that read the #! line and tried to figure out which python version to call, and defaulted to Python3 if it couldn't find a #! line. I always felt this was the "correct" way of solving this.

Nowadays, I just only install Python3 on machines, so it's not really a problem for me anymore.

"Yes, the command line itself has ads for the store sprinkled throughout it." - this is a bit of a leap... Those helper scripts have been mostly applauded in the Python community for offering an easy way to get Python installed on a Windows computer. If you are seeing the store links after installing the official version of Python, then you've probably just got an issue with your PATH. Perhaps you chose not to add Python to the PATH?
Does OSX do this with the xcode tools?
Yes, and as a linux admin and user who is stuck on MacOS for work, it drives me absolutely nuts, even more so when people defend apple or microsoft with justifications that the other does it. They both suck.
I don't really think being told to run `xcode-select --install` is worse than being thrown into the Microsoft Store, because one is a flow-breaking action, and the other is not. If I'm at a Terminal and I don't have something installed, the fastest way to resolve the problem is with a Terminal command.
It's not that simple. That command forced me over to the app-store to log into my apple id the last time I ran it for example. You may run it enough or be inside the ecosystem enough that you haven't run into that, but then when my apple-id had errors (I don't buy apps, and only have it because apple forces you to, so I almost never log in with it), I couldn't install xcode... and had to go find a fix on some random forums. Now that I finally fixed all that, the updates are smoother, but it wasn't a pleasent initial experience and did not allow me to stay in the terminal.
iOS and OSX are littered with Ads. I've even seen ads in Apple apps (Music for example) where there shouldn't be any (for example, popping up a full screen ad in front of the screen to play a song I already own). I use both Apple and Microsoft OSs on a daily basis. Anyone who thinks Apple doesn't do this stuff isn't paying attention.
That’s not the same as cluttering dev tools with ads (though I agree that the Apple OS ad situation is bad)
No. At worst it prompts you to download and install the Command Line Tools (all actionable inside the prompt; it doesn’t use the App Store) if you try to run a command not included in the OS by default like `git`.
How is that different than what windows does with "python3"?
In fairness, annoyed though I was, the command line message you get in Windows includes directions into the settings page to disable the feature, and any others like it while you're in there.

The real surprise was mostly that python3.exe isn't included in the 3.9.x download, despite the documentation mentioning it in a few places. Since the error message didn't name drop the executable, and it appeared python was otherwise installed and working (and even available as "python" on PATH) it took some sleuthing to locate the real issue. I'm sure there's a better fix than copying "python.exe" and renaming it "python3.exe" but that worked, and I had stuff to do, so it's fine. :)

Windows doesn't present you with any actions or choices inside the command prompt. It just immediately opens the Microsoft Store to the Python 3.9 page.
It doesn't do that, if you install git in some other way (via homebrew, or manually). So it is definitely different from this:

> even after installing Python from the official website, if you happen to run a script that executes "python3" instead of "python", you'll instead trigger an unhelpful link to the Microsoft Store

The point is that python3 was already in place, and the package on the official website only created the python executable, so the stub linked to the Microsoft Store wasn't overwritten.

This is no different than macOS. If you don't overwrite the existing stubs, you get the "install xcode" message when running git or cc.

But if Apple does it, it's OK because they're the good guys.

There's no overwriting stubs in MacOS. With SIP enabled, not even root can write into /usr (the apple stub is /usr/bin/git).

Many users use git from homebrew; once you do 'brew install git', the stub won't bother you, despite homebrew not overwriting anything. It is just earlier in the $PATH. And that's the issue with Windows: the standard installer does create python3.exe, it is just later in the %PATH%, because Microsoft placed the stub in one of the early directories. Normal, well behaved installer, which places its entry at the end won't be able to override anything.