Python not showing correct version

Eryk Sun eryksun at gmail.com
Fri Mar 31 17:02:35 EDT 2023


On 3/31/23, Thomas Passin <list1 at tompassin.net> wrote:
>
> The store app doesn't install py.exe, does it?

That's a significant downside of the store app. You can install Python
3.7-3.11 from the store, and run them explicitly as "python3.7.exe",
"pip3.7.exe", "python3.11.exe", "pip3.11.exe", etc. But without the
launcher there's no shebang support for scripts, so you can't easily
associate a script with a particular Python version or a particular
virtual environment. Shell shortcuts/links (.LNK files) can work
around the lack of shebang support (add .LNK to the PATHEXT
environment variable). But having to create a separate shell link is
inconvenient, and it's not cross-platform.

The OP installed the standard Python 3.8 distribution, which does
install the launcher by default. The launcher can run all installed
versions, including store app installations. By default it runs the
highest available version, which will probably be the 3.10 store app
in the OP's case. To make 3.8 the default without having to remove
3.10, set the environment variables "PY_PYTHON=3.8" and
"PY_PYTHON3=3.8" in the user environment.


More information about the Python-list mailing list