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

  1. By altering the environment variable named PATH so that it includes
    C:\Users\user\AppData\Local\Python\pythoncore-3.13-64
    earlier in the path than the location of any other versions of python. Ideally it would be the only occurrence in PATH of a location of a Python version. The others should be omitted. Or ...

  2. By removing any Python locations from PATH and creating a python3.cmd file in a location in PATH. For example, I have a scripts folder in my home directory that I include in my PATH. The python3.cmd can temporarily adjust PATH if python needs it to e.g find libraries etc.

Answer from RedGrittyBrick on Stack Exchange
🌐
InfoWorld
infoworld.com › home › software development › programming languages › python
Get started with the new Python Installation Manager | InfoWorld
June 11, 2025 - The asterisk indicates which version of Python is the default according to the Installation Manager. Just typing py brings up that version. But if you want to change it, you can set an environment variable.
Discussions

How to set default version when multiple versions are installed
Enter, py -0p to list Python versions installed on your system. One with asterisk is the default. You can specify explicitly which version to run, e.g. py -3.9-64 Set PY_PYTHON or PY_PYTHON3 environment variables to have a different default. (PY_PYTHON2 is used for legacy Python.) More: https://www.infoworld.com/article/3617292/how-to-use-pythons-py-launcher-for-windows.html More on reddit.com
🌐 r/learnpython
9
2
June 8, 2022
Allow setting a python version using py use 3.13 command
A default version may be configured either via PYTHON_MANAGER_DEFAULT or default_tag in a config file. Perhaps this could be added to py install --configure, but the existing methods seem fine. ... I thought about adding it to the first run experience, but couldn't really come up with a good way. Setting ... More on github.com
🌐 github.com
May 29, 2025
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\Ap... More on discuss.python.org
🌐 discuss.python.org
6
0
March 10, 2026
How to change default python in `py-launcher` at windows?
Hello, I tried to install multiple python versions on my windows machine, I have this version: ❯ py --list -V:3.11 * Python 3.11 (64-bit) -V:3.10 Python 3.10 (64-bit) -V:3.9 Python 3.9 (64-bit) How do I change the default python version to 3.10 when I type py in terminal? because if I type ... More on discuss.python.org
🌐 discuss.python.org
3
0
May 20, 2022
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.15.2 documentation
This section will describe the defaults, but be aware that modified or overridden installs may resolve settings differently. A global configuration file may be configured by an administrator and would be read first. The user configuration file is stored at %AppData%\Python\pymanager.json (note that this location is under Roaming, not Local) and is read next, overwriting any settings from earlier files. An additional configuration file may be specified as the PYTHON_MANAGER_CONFIG environment variable or the --config command line option (but not both).
🌐
Reddit
reddit.com › r/learnpython › how to set default version when multiple versions are installed
r/learnpython on Reddit: How to set default version when multiple versions are installed
June 8, 2022 -

I have both 3.10 and 3.11b3 installed on my windows 10 machine. I'd like py.exe to launch 3.10.

I had read that I should create py.ini and pyw.ini in both \windows and C:\Users<user>\AppData\Local\Programs\Python\Launcher\ and the files should contain:

[defaults]
python=3.10

I've done this, but py.exe launches 3.11b3. I don't have any other py.ini files. How do I fix this so \windows\py.exe launches my preferred default version?

EDIT: see https://stackoverflow.com/questions/68121982/multiple-python-versions-installed-how-to-set-the-default-version-for-py-exe

I could use py -3.10 to launch, but from the link there should be a way to just use py

🌐
Pages
lotta.pages.dev › posts › pymanager
PyManager: Reinventing the Python Launcher
October 25, 2025 - The entry with the asterisk at the end indicates the default Python runtime that will be used when launching py. If you need to change the default version, you may do this via the PYTHON_MANAGER_DEFAULT environment variable or as documented in the Configuration section of the docs.
🌐
GitHub
github.com › python › pymanager › issues › 123
Allow setting a python version using py use 3.13 command · Issue #123 · python/pymanager · GitHub
May 29, 2025 - ... py use 3.14 can change the environment variables to use this python version. py default 3.13 will set the default python version, this will change an environment variable or the config file to remember the default python version.
Find elsewhere
🌐
Python.org
discuss.python.org › python help
How can I set the default Python version that gets launched when typing python3 (On Windows 11)? - Python Help - Discussions on Python.org
March 10, 2026 - 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...
🌐
Python.org
discuss.python.org › python help
How to change default python in `py-launcher` at windows? - Python Help - Discussions on Python.org
May 20, 2022 - Hello, I tried to install multiple python versions on my windows machine, I have this version: ❯ py --list -V:3.11 * Python 3.11 (64-bit) -V:3.10 Python 3.10 (64-bit) -V:3.9 Python 3.9 (64-bit) How do I change the default python version to 3.10 when I type py in terminal? because if I type ...
Top answer
1 of 3
15

If anyone is looking for this in 2023:

Goto your Environment Variables....

Under System variables, look for the variable PY_PYTHON. If it exists, you can change its value to the version of Python you want to use by default (for example, 3.10 or 3.11). If it doesn't exist, you can create it by clicking on New..., entering PY_PYTHON as the variable name, and the desired Python version as the variable value.

Click OK to apply the changes.

To verify your changes, open a new command prompt and type py. It should start the Python interpreter in the version you specified.

2 of 3
7

To set the default version of Python, you need to have installed Python Launcher (cf below for some info). If you didn't, you can probably install it by using the installation .exe of one of your Python installations, and selecting modifying/repair.

You also need to know where your Python Launcher is:

  • if you installed it for all users, it is in C:\WINDOWS\,
  • if not, it is in %USERPROFILE%\AppData\Local\Programs\Python\Launcher\.

In this example, the latest installed version of Python is Python 3.11 but the version that should be the default one is Python 3.6.


To set a default Python version:

  • go to your Python Launcher Folder and create 2 files: py.ini and pyw.ini

  • make sure that both of these files are UFT-8 (they shouldn't be UFT-8 with BOM)

  • add to each of these files:

     [defaults]   
     python=3.6
    
  • now, right click on any .py, select open with, select check another app, check Always use this app..., scroll all the way down and click on more app... and navigate to your Python Launcher folder and select the py.exe.

  • do the previous step again but this time, right-click on a .pyw file and select the pyw.exe.


How to use it

● in a CMD:

  • Do not use anymore python in CMD, always use py. If you type just py, then it will open a Python 3.6 console. If you want a Python 3.11 console, type py -3.11.

  • As indicated in the comment by @karl-knechtel: If you have an active venv, using python instead of py` will prioritize the venv's Python, which is generally what you want.

  • To use pip to install :

    py -3.11 -m pip install # will install package for 3.11 py -m pip install # will install package for 3.6

● For python files:

  • If the file doesn't contain a shebang, then it will be started with the default Python version which is 3.6.
  • To use Python 3.11 for this file, add the shebang #!python3.11 at the very top of your script

To verify that everything is working:

  • open a CMD, write py -0p and look for the *. It should be next to the default version you have set in the .ini files.

    Installed Pythons found by py Launcher for Windows
    -3.11-64 C:\Users<user>\AppData\Local\Programs\Python\Python39\python.exe
    -3.6-64 C:\Users<user>\AppData\Local\Programs\Python\Python36\python.exe *

  • With this setup, you can use the specific version of Python that you need in your scripts:

    • 3.6 (as it will call the default version)

      import sys   
      print(sys.version_info)  
      input("close")  
      
    • 3.6 (as it will call the default)

      #!python   
      import sys   
      print(sys.version_info)   
      input("close")   
      
    • 3.11

      #!python3.11   
      import sys  
      print(sys.version_info)   
      input("close")   
      
    • 3.11 (as it is the latest python 3 installed)

      #!python3    
      import sys   
      print(sys.version_info)   
      input("close")   
      

Some info about the Python launcher from docs.python.org

The Python launcher for Windows is a utility which aids in locating and executing of different Python versions. It allows scripts (or the command-line) to indicate a preference for a specific Python version, and will locate and execute that version. Unlike the PATH variable, the launcher will correctly select the most appropriate version of Python. It will prefer per-user installations over system-wide ones, and orders by language version rather than using the most recently installed version.

Two .ini files will be searched by the launcher - py.ini in the current user’s “application data” directory [...] and py.ini in the same directory as the launcher. The same .ini files are used for both the ‘console’ version of the launcher (i.e. py.exe) and for the ‘windows’ version (i.e. pyw.exe).

Customization specified in the “application directory” will have precedence over the one next to the executable, so a user, who may not have write access to the .ini file next to the launcher, can override commands in that global .ini file.

⚠ Your python version can be installed either for all user (python.exe will be in program files) or for the profile (python.exe will be in appdata). If it doesn't work, try uninstalling all python version, and the launcher and reinstall everything as current user to start clean. To do that, download the .exe of your current Python installation, run it and click on uninstall (dont delete the remaining folder in app data if you want to keep your python packages), then reinstall it. If you install the launcher for all users but python for current user, your python.exe will be in appdata (a folder for each version), and your launcher will be C:\Windows\py.exe

If you want to install it for all "all users" and the check box is grayed out: you need first to uninstall the python launcher. If it's still grayed uninstall the python version(s) that remains (everything wil be in program files).

🌐
YouTube
youtube.com › watch
How to use the new Python Installation Manager tool for Python 3.14 - YouTube
Python 3.14 has rolled out a new official tool for adding, removing, and maintaining various versions of Python on Microsoft Windows. It also eclipses the ex...
Published: May 27, 2025
🌐
PyDevTools
pydevtools.com › home › python developer tooling handbook › reference › pyenv
pyenv: Python Version Manager | pydevtools
September 7, 2026 - # List all available versions pyenv install --list # Install a specific version pyenv install 3.12.4 # Uninstall a version pyenv uninstall 3.12.4 · pyenv supports three scopes for version selection, each overriding the one below it: # Set the version for the current shell session pyenv shell 3.12.4 # Set the version for the current directory (writes a .python-version file) pyenv local 3.12.4 # Set the default version for your user account pyenv global 3.12.4
🌐
YouTube
youtube.com › watch
How To Change Default Python Version on Windows 10 or 11 - YouTube
Struggling to set the default Python version on Windows 10 or 11? This video shows step-by-step how to change the default Python interpreter, so your system ...
Published: May 18, 2025
🌐
Reddit
reddit.com › r/python › python official version manager - pymanager
r/Python on Reddit: python official version manager - Pymanager
July 14, 2025 -

python/pymanager: The Python Install Manager (for Windows)

it seems python released it's own version manager (like pyenv, uv) , which can help manager mutiple python versions and set default , auto download ...

it't very new , i just found out yesterday , i didn't see people talk about it

any way , it's new and provide more options , we can try it .

🌐
YouTube
youtube.com › watch
Python Install Manager on Windows – Overview & Essential Commands - YouTube
I walk through the Python Install Manager for Windows (pymanager). If you have older Python solutions, you should first:1. Note of the Python versions associ...
Published: February 2, 2026
🌐
GitHub
github.com › python › pymanager › issues › 263
Change dafault version command · Issue #263 · python/pymanager · GitHub
January 31, 2026 - This update adds global shortcuts for installed scripts such as pip.exe. Use py install --refresh to update all shortcuts. This will be needed after installing new scripts, as it is not run automatically.
🌐
Posit
docs.posit.co › ide › server-pro › admin › python › configuring_default.html
Configuring the Default Version of Python – Workbench Documentation Release 2026.10.1
You can set the default Python interpreter by modifying the system PATH. The recommended method to add Python to the PATH is to append the version of Python that you installed to the system-wide PATH variable.
🌐
Python
python.org › downloads › release › pymanager-252
Python Release Python install manager 25.2 | Python.org
December 5, 2025 - The install manager can install versions of Python as far back as 3.5, but only supports Windows 10 operating systems (or Windows Server 2022) and later.
🌐
Python.org
discuss.python.org › ideas
In-built Python Version Manager (PVM) and Package Manager - Ideas - Discussions on Python.org
September 18, 2024 - The PVM should offer the following subcommands: pvm list or pvm ls: Lists all locally installed Python versions. pvm list-remote or pvm ls-remote: Lists all available Python versions for download, including alpha and beta versions. pvm install : ...