3 ms·
There's an actual term for this "fake" command: it's a stub command. Stub commands are by no means a new concept; for instance, on macOS many CLT commands are s
by oefrha 7y ago
There's an actual term for this "fake" command: it's a stub command. Stub commands are by no means a new concept; for instance, on macOS many CLT commands are stubs (that prompt CLT installation), and IIRC the java family of commands in /usr/bin are stubs out of the box, too.
The real problem, or the claimed problem, is
> Windows 10 puts a fake python/3 executable in the path, ahead of the actual python.
(Emphasis mine.)
Somehow I'm on the slow ring and I'm not affected by this; the stub is definitely not ahead of the actual python. Why? Because C:\Python38\Scripts and C:\Python38 are way ahead of %LocalAppData%\Microsoft\WindowsApps (where the python.exe stub lives) on my PATH. When you install things naturally they prepend themselves to the path, CPython (or any python) installers included. Begs the question: what kind of geniuses put third-party paths after system paths, then bitch about breakage?
Edit: Upon further inspection of some complaints, I think what Microsoft should do is fixing then teaching people proper PATH management on Windows (which is terrible), since apparently all the top google-surfaced tutorials ask you to append to PATH, which opens you up to this kind of self-inflicted problems. (Clicking on "New" when editing PATH creates a new entry at the end; obviously doesn't help.)
- JadeNB 7y agoCLT = Command-Line Tools, for those unfamiliar. (Unfortunately, I can't find an official link that's not behind a developer.apple.com sign-in.)
- oefrha 7y agohttps://developer.apple.com/library/archive/technotes/tn2339/_index.html https://developer.apple.com/library/archive/technotes/tn2339...
- Igelau 7y agoThat was a weird experience when I started using MacOS. "Why are we faking that Java and git are already on here?"
- knolax 7y agoOk but what purpose do stub commands serve? What user is smart enough to be running command line tools but also too stupid to figure out how to install Python? Even if you did want to tell users how to install it you could just do it the Ubuntu way and make it a part of the error the shell throws when it can't find the program. If a program is not installed the expected behavior is that trying to run it leads to some sort error, not a fake program that engages in completely different behavior. If I see /usr/bin/python on my system then I'm going to assume that Python is installed. There's no point in subverting that expectation.
- oefrha 7y agoA lot of non-technical users are told to run this, run that in the console to solve random problems all the time. When they get an error they don’t try to interpret it, they get all confused and send you a screenshot (that behavior isn’t even non-technical user specific). Popping up an actual solution where they could install in a few clicks is actually welcome. I would also think that people who are smart enough to complain about this are smart enough to understand path resolution and no fuck up their PATH, but here we are. Who would have guessed.
- knolax 7y agoThis isn't about PATH resolution, this is about pretending to have a program installed when it isn't. As other comments have pointed out, this "actual solution" also fucks up any Python script you try to run because nobody writes scripts thinking "what if python isn't actually python". What's next, selling a car that looks like it has an engine, but on closer inspection actually only has a flyer for the closest mechanic under the hood? Should I check if my plane actually has wings instead of cardboard cutouts made to look like wings every time I take a flight too?
- tssva 7y agoIf the python version from the Microsoft Store is installed the path is not changed. Instead the "stub commands", in Windows terms they are app execution aliases, now point to the python version installed by the store. In fact additional app execution aliases are created for other variations of the python command name along with ones for idle and pip.