Today we’ve released the first beta of the next install manager update.
There is one major change in this version, and I would really like to hear some people making use of it before rolling it out to all users. Other changes are fairly minor.
First, minor changes
- authenticated proxy servers should now auto-logon when the OS knows the credentials
- shebang lines in scripts may now choose the version for automatic installs (e.g. if you
py exec my-script.pyand it contains#! python3.13but you don’t have 3.13 installed) - shebang lines won’t cause
pyw/pythonwwindowed launchers to pop up consoles (e.g. if you didn’t specify#! pythonwas the shebang)
Script entry points
One of the biggest gaps with the initial release was that each installed runtime would not be added to PATH. This is fine for the main install directory, which only ever contained python[w].exe, because we have a central directory that gets generated shortcuts for all installed versions (correctly ordered, etc.).
However, it mattered a lot for the Scripts directory, which contains executables generated by pip or other installers that do global installs. Most notably, pip.exe would not be globally available after installing a runtime, and even though we recommend people use virtual environments rather than global installs,[1] it still caused quite a bit of upset.
Not wanting to prioritise pip over other tools, we now generate launcher executables for all detected entry_points.txt files in .dist-info directories under known package install directories. The first two parts following the packaging specification, and the latter has been added as a field in the feed, defaulting to Lib\site-packages and Scripts (which covers regular CPython for all existing releases).
In short, the py install --refresh step now generates pip.exe and similar for all installed packages that register an entry point. This step runs automatically after runtime installation, but does not run after package installation (installers could choose to run it if they want). For now, after installing a new global command, users will have to run py install --refresh themselves.
The launchers are created following the same order as interpreter aliases, so if two installs have the same command then you get a consistent (and hopefully obvious) result. They all go in the same directory as the versioned commands, which we offer to add to PATH for you and regularly warn if it’s not there. We still recommend py -V:<version> -m command ... to launch all of these, particularly if users need to be sure which one is going to run. But by making the basic command more accessible, we hope to reduce complaints and at least satisfy simple cases (one installed runtime, no venv).
But as you can tell from the length of my explanation, there are some tricky moving parts here. Any testing would be greatly appreciated - replace your install with the beta linked above (or if you’ve installed a previous beta, you should get this one automatically within a day or so). I’d especially like to hear some positive “works for me” comments, as well as any issues (either here on on the tracker).
Which work fine, incidentally, because activating a venv puts its own
Scriptsdirectory onPATH. ↩︎
