[Python-Dev] New Windows installer for Python 3.5

Steve Dower Steve.Dower at microsoft.com
Mon Jan 5 18:09:12 CET 2015


Mark Lawrence wrote:
> If I'm reading this correctly it means that py.exe gets picked up from PATH so
> it could be 32 or 64 bit. Does this mean that the launcher could be or needs
> enhancing so 32 or 64 bit can be selected? I'm not sure if anything can be done
> about pyw.exe, perhaps you (plural) can throw some light on this for me.

We only ever install a 32-bit launcher (including with the current installer, though it doesn't quite work properly), so this isn't really an issue. To explicitly request a 32-bit interpreter you can pass "-3.5-32" - without the "-32" suffix you'll get 64-bit if it's there and 32-bit otherwise.

Paul Moore wrote:
> Steve is in essence saying that it's not possible to sanely manage PATH as part
> of the new installer, but that py.exe makes that unnecessary.

It's actually not possible to sanely manage PATH from any installer - it really needs to be handled by a user directly (though I can't ever bring myself to tell anyone to use the UI for it). The old installers were less susceptible because they didn't support per-user installs, but you'd still get the "last install Python wins" behaviour.

> My point is that while py handles the interpreter, it doesn't handle things like
> pip (unless we change the standard usage instructions to say "py -m pip" is the
> supported approach on Windows).

Or we make pip3.5.exe launch against 3.5 and pip.exe and pip3.exe behave like the launcher, regardless of where they run from.

For example, say I have Python 3.5 and Python 3.6 installed and PATH=C:\Python35;C:\Python35\Scripts;C:\Python36;C:\Python36\Scripts;... (yes, those are the 'wrong' way around). If I just type "pip" it will run C:\Python35\Scripts\pip.exe, which may or may not be what I expect.

If pip behaved like the launcher, it would find the latest installed version (3.6) and launch pip3.6.exe, which would always run against C:\Python36\python.exe. (How does it do this? No idea yet. Technical details...)

This might also mean you could write "pip -3.5 install ..." to run against a specific version, but that doesn't have to be supported if it's likely to break scripts by stealing an argument. Since we'll install "pip", "pip3" and "pip3.5", the options are already there.

Would we need "pip3.5-32" as well? This could get out of hand pretty quickly. Perhaps the launcher could include "usepy -3.5" to update the user's PATH for the current session? Would that get any more use? I don't know, but it feels unlikely. There have been multiple requests for the Add to PATH option to be enabled by default in the installer, but frankly it concerns me too much to do so. There are too many effects that most users won't expect.

Cheers,
Steve


More information about the Python-Dev mailing list