How can I set the default Python version that gets launched when typing python3 (On Windows 11)?

Overview

My exact goal is to set my preferred version of python as the default when I type python3 into a command prompt or powershell prompt. I’ve tried everything but can’t figure it out.

I have the following Python versions installed (Output of py -0p):

 -V:3.14[-64]    C:\Users\user\AppData\Local\Python\pythoncore-3.14-64\python.exe
 -V:3.13[-64] *  C:\Users\user\AppData\Local\Python\pythoncore-3.13-64\python.exe
 -V:3.12[-64]    C:\Users\user\AppData\Local\Python\pythoncore-3.12-64\python.exe

I’ve set the following environment variables system-wide, and for my user account:

PY_PYTHON                        = "3.13"
PY_PYTHON3                       = "3.13"
PYTHON_MANAGER_DEFAULT           = "3.13"
PYTHON_MANAGER_DEFAULT_PLATFORM  = "-64"
PYTHONUTF8                       = "1"

Unfortunately when I type python3 into a command prompt, it launches the python 3.14 shell.

How can I ensure that when I enter python3 in a CLI prompt that it launches my preferred version of python (3.13)?

Additional Info:

I’ve disabled two of the app execution aliases in my Win11 settings hoping this might solve the issue:

But it’s not working.

Can someone point me in the right direction? Thanks in advance for any help!

If you use the python3 name then set the PATH so that your preference is first.

If you use the py command then you can edit py’s py.ini file to set the preference. This is what I do on my Windows systems.

See the python windows does for details.

1 Like

If you type in echo %PATH% is there a non-managed Python 3.14 in the order before py? Press windows and type “env”, to edit the Path (and other env vars).

Or does the preferred Python 3.13 not have a “python3” alias?

If you’re using Bash it’s possible to set up an alias too. A good old cmd batch file is clunkier, but will work.

Quick and dirty information can usually be obtained by typing a command like this

python3 -c"import sys;print(sys.version);print(sys.exec_prefix)"

on my system I see this (in a venv)

3.14.3 (main, Feb 4 2026, 13:06:20) [GCC 15.2.1 20260103]
/home/robin/devel/reportlab/.py314

I still download and run the installation .exe files and click the “Make this the default Python” (for >py, not the >python3 that I never use). I believe the installer for pythonx.y could be rerun to make it the default.

But the downside is that if you install a different python for testing you risk switching the default.

Using py.exe and it’s py.ini puts you, the user, in control.