On Sun, 28 Feb 2021 at 07:04, Stephen J. Turnbull <turnbull.stephen...@u.tsukuba.ac.jp> wrote: > > Jim J. Jewett writes: > > > > which file am I actually running? > > > which interpreter am I actually running? > > > how do I tell the computer to use a different interpreter? > > > > If you need to care about any of these, then the environment is > > fighting you -- and the application probably stinks. Programmers > > have to deal with it because of bootstrapping, but there is no > > reason that we should assume all python users need that flexibility > > or want that responsibility. > <snip> > > So I agree with the basic principle that programs should Just Work by > default, but it's not always possible. Eg, there's good reason why > Downloads and Documents both exist. So it helps to have users know > something about implementations and sysadminning stuff, especially > when remote troubleshooting. > > The question for Python is given the history and the plethora of ways > to invoke Python and find packages and programs, can we do better with > a minimum of backward incompatibility? Humans are generally better at > learning this stuff than bags of bits on spinning platters are!
I think that the py launcher is actually a good solution to many of these problems. It can also be improved but the main reason it doesn't help right now is just the fact that it's only for Windows and also isn't always installed on Windows. When the launcher is installed though then: - It is on PATH - It can list the Python installations with "py -0p" - It can be used to select a particular Python version/installation to use from the command line e.g. "py -3.8 myscript.py" - It is possible to configure a default version (although I think you have to do it with an environment variable) There are some ways that the launcher situation could be improved though: - I think that the launcher is only installed in an all users install. There would need to be a way to do it in user-space as well (even if it means the user has to configure PATH). - Listing installations with "py -0p" is somewhat cryptic - It would be better if you could use the launcher itself to set the default Python e.g. "py --set-default-python=3.8" - The launcher isn't installed by Anaconda On the last point I think that although Anaconda doesn't install the launcher you can use the launcher to run the python from the Anaconda installation. Ideally Anaconda would install the launcher but it could also be possible to install it separately. If py was provided on OSX, Linux etc along with the very clear guidance that it is supposed to be for "users" rather than the "system" then maybe that could be a better situation. It would be backwards compatible since the launcher already exists on Windows and "py" hasn't been used for anything on non-Windows platforms (AFAIK). -- Oscar _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/LZGV4DDFZKA4NYQVR6JVNG4HVBXDRZFZ/ Code of Conduct: http://python.org/psf/codeofconduct/