On 17 March 2016 at 09:14, Paul Moore email@example.com wrote:
On 17 March 2016 at 08:10, Stephen J. Turnbull firstname.lastname@example.org wrote:
If someone installs a version of python with defaults, they should then get that version when they type "python" (or maybe "py") at the command line.
If they want something other than the last one they installed, then they'll have to mess with PATH or other configuration...
In theory, this makes sense to me.
Really? To me, it never made a lot of sense even in theory. It's most likely to totally screw exactly the users it's addressed to (the ones who don't know how, don't wanna know how, and probably shouldn't be allowed, to manipulate PATH).
Hmm, I think I follow what you're getting at.
It does seem reasonable to me that if a user installs (a version of) Python, then they should find that the "python" command works and executes that version.
Great! I'm glad that we're agreed on the basic point that:
Python is installed in standard way implies -> "python" command works in all the usual places
Particularly so now that a default install of Python 3.5 on Windows puts the executables in a relatively hard to locate directory (so manually adding to PATH is tedious). Replace the "python" command with "py" in this statement and we have the current behaviour of the Python installer.
I'm OK with conceding that anyone installing a second version of Python counts as an "advanced" user and should manage the results themselves :-) (Exception: if you uninstall your current version first, you're back to the "new install" case).
So for new users (without Python install): "Install your preferred copy of Python, and use the command py to run Python (either to run a script, or for interactive use)".
What? I thought we just agreed it should be "python"! :)
This brings us full circle back to the reason I interjected in this thread: why are we making the standard invocation of Python different on Windows?
I'll drag up a bit of conversation from earlier:
On 15 March 2016 at 04:47, Nick Coghlan email@example.com wrote:
On 15 March 2016 at 09:01, Paul Moore firstname.lastname@example.org wrote:
I apologise if I gave the impression in this thread that there's any sort of "official" change in advice on how to launch Python. As far as I know, there hasn't been.
It's still "python" - that works regardless of version on Windows (with a suitably configured PATH), in virtual environments and in pyenv and conda environments (and probably in Enthought Canopy as well, but I haven't checked that).
(and it's also "python" on every other non-Windows OS I've used, leaving aside "python3")
So are we agreed or not that "python" is the way to run... Python?
I'm also inclined to assume that for the *really* "new to IT" users, Idle (which is available as a start menu item) is a better starting point anyway.
My own students are introduced via Idle and have no problem (on Windows or OSX) locating Idle graphically. It's later on when we expect them to use the command line they discover that they have PATH problems. But this is happening at the first point that they use the terminal (it seems natural since they've learned Python already that it should be one of the first terminal commands they would use).
The installer already has the capability and a tickbox for this. See here: https://docs.python.org/3.5/using/windows.html
The tickbox that says: "Install launcher for all users (recommended)" is ticked already and describes itself as being "recommended". The one that says "Add Python 3.5 to PATH" is unticked and apparently not "recommended".
If we're agreed that the "python" command should work once Python is installed then why are we not "recommending" that people tick the box that does this?
Advanced users should understand what this means and can decide for themselves whether or not they want to tick/untick this box so I don't see why they're relevant on the issue of what is default and what is recommended. Novices won't understand what the text means so we really need to think about them when choosing a default behaviour here.
How about a UI that shows the user what Pythons are installed and allows them to select which one is on PATH?
Another option would be to add a path configuration menu to Idle. This way a user can open Idle, go to something like settings->PATH configuration and then be presented with a list of installed Pythons and the ability to select which should be on PATH. That would be better than asking novices to go edit PATH but it still begs the question: if this is part of the standard setup then why is not standard to do it when installing?