0

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?

haley
  • 845
  • 1
  • 7
  • 15
  • Aside from previous questions, please read the [relevant documentation](https://docs.python.org/3/using/windows.html#python-launcher-for-windows) for the `py` command in order to understand what it is doing differently from `python`. The short version is that `py` is always one specific program that is always on the PATH, and uses its own logic to choose an installed Python. Using `python` means 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. – Karl Knechtel Jul 22 '23 at 08:31
  • (Aside from that, consider whether you really still need 2.7 on your computer - since it's a Windows machine, the operating system won't depend on it, and it's very outdated now - comparable to Windows 7.) – Karl Knechtel Jul 22 '23 at 08:32

0 Answers0