I have Python 3.11.4 installed and at the very start of my PATH variable. I also have Python 2.7.15 installed because GIMP depends on it for extensions. I want to use Python 3 instead of Python 2 in Command Prompt, but python -V returns 2.7. Weirdly enough, py boots into the 3.11.4 REPL.
PS C:\Users\Haley> py
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>> quit()
PS C:\Users\Haley> python -V
Python 2.7.15
How can I reconfigure my Command Prompt or Windows install to use Python 3.11.4 all across the board?
pycommand in order to understand what it is doing differently frompython. The short version is thatpyis always one specific program that is always on the PATH, and uses its own logic to choose an installed Python. Usingpythonmeans that the PATH needs to be searched and whichever Python appears first on the path (if any) is the one that gets used - just like for any other executable name at the command prompt.