This is if you have both the versions installed.

Go to This PCRight-clickClick on PropertiesAdvanced System Settings.

You will see the System Properties. From here navigate to the Advanced Tab -> Click on Environment Variables.

You will see a top half for the user variables and the bottom half for System variables.

Check the System Variables and double-click on the Path (to edit the Path).

Check for the path of Python(which you wish to run i.e. Python 2.x or 3.x) and move it to the top of the Path list.

Restart the Command Prompt, and now when you check the version of Python, it should correctly display the required version.

Answer from Aditya Deshpande on Stack Overflow
Top answer
1 of 16
191

This is if you have both the versions installed.

Go to This PCRight-clickClick on PropertiesAdvanced System Settings.

You will see the System Properties. From here navigate to the Advanced Tab -> Click on Environment Variables.

You will see a top half for the user variables and the bottom half for System variables.

Check the System Variables and double-click on the Path (to edit the Path).

Check for the path of Python(which you wish to run i.e. Python 2.x or 3.x) and move it to the top of the Path list.

Restart the Command Prompt, and now when you check the version of Python, it should correctly display the required version.

2 of 16
120

The Python installer installs Python Launcher for Windows. This program (py.exe) is associated with the Python file extensions and looks for a "shebang" comment to specify the python version to run. This allows many versions of Python to co-exist and allows Python scripts to explicitly specify which version to use, if desired. If it is not specified, the default is to use the latest Python version for the current architecture (x86 or x64). This default can be customized through a py.ini file or PY_PYTHON environment variable. See the docs for more details.

Newer versions of Python update the launcher. The latest version has a py -0 option to list the installed Pythons and indicate the current default. py -h lists complete Python Launcher options as well as Python options.

Here's how to check if the launcher is registered correctly from the console:

C:\>assoc .py
.py=Python.File

C:\>ftype Python.File
Python.File="C:\Windows\py.exe" "%1" %*

Above, .py files are associated with the Python.File type. The command line for Python.File is the Python Launcher, which is installed in the Windows directory since it is always in the PATH.

For the association to work, run scripts from the command line with script.py, not "python script.py", otherwise python will be run instead of py. If fact it's best to remove Python directories from the PATH, so "python" won't run anything and enforce using py.

py.exe can also be run with switches to force a Python version:

py -3 script.py       # select latest Python 3.X version to be used.
py -3.6 script.py     # select version 3.6 specifically.
py -3.9-32 script.py  # select version 3.9 32-bit specifically.
py -0                 # list installed Python versions (latest PyLauncher).

Additionally, add .py;.pyw;.pyc;.pyo to the PATHEXT environment variable and then the command line can just be script with no extension.

🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.14.4 documentation
You can download the Python Install Manager from python.org/downloads or through the Microsoft Store app. Once you have installed the Python Install Manager, the global python command can be used from any terminal to launch your current latest ...
Discussions

Switching between versions of python installed from microsoft store
So I installed python 3.9 and 3.7 from the microsoft store because I need both versions for certain projects, and I am wondering if it is possible to switch between which version of python I want my system to use. More on learn.microsoft.com
🌐 learn.microsoft.com
1
0
February 8, 2021
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
5
0
1 month ago
Change actual python-version in cmd?
You didn't mention what OS you're using, but on Windows, just use the Python launcher. py -m venv whatever It defaults to the highest version number you've got installed, but you can specify a version if you need to. py -3.9 -m venv thingy EDIT: You can also reorder the entries in your PATH environment variable to make sure 3.12 is before 3.9. More on reddit.com
🌐 r/learnpython
6
3
May 21, 2024
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
🌐
CodeGenes
codegenes.net › blog › how-to-change-my-global-python-in-windows-11
Changing the Global Python Version in Windows 11 — codegenes.net
In the context of Python, the PATH environment variable is crucial. It tells the operating system where to look for executable files. By modifying the PATH variable, we can change which Python version is the global one. You should have multiple Python versions installed on your Windows 11 system.
🌐
YouTube
youtube.com › watch
How to Switch and Change Python Version in Windows 10/11 - YouTube
In this tutorial we will see how to switch and change python version in Windows 10 and 11
Published   September 25, 2024
🌐
Reddit
reddit.com › r/learnpython › change actual python-version in cmd?
r/learnpython on Reddit: Change actual python-version in cmd?
May 21, 2024 -

Generally i was using the latest python version 3.12. in my terminalk
So when i created a virtual environment with

python -m venv xyz

the created virtual environment was under 3.12

For testing purposes it was now necessary to also install python version 3.9.

But now when i am using venv to create a new virtual environment it is the version 3.9.

How can i change the "standard" python-version bakc to 3.12. when i am creating a virtual environment using venv?

Find elsewhere
🌐
C# Corner
c-sharpcorner.com › article › how-to-manage-multiple-versions-of-python-on-windows-11
How To Manage Multiple Versions Of Python On Windows 11
April 13, 2022 - You can download the installer for Python 3.10 here. You can learn to install python3 on Windows here. We will now create copies of the python executable and rename them to python27 and python310.
🌐
Medium
medium.com › @dandi.mahendris › set-up-different-python-version-in-windows-1d5cf3b652dd
Set-up Different Python version in Windows | by Dandi Mahendris | Medium
July 25, 2023 - Python 3.11: $ python -m virtualenv --python python311 venv311 Python 3.10: <---------- $ python -m virtualenv --python python310 venv310 ... How to Set Up a Virtual Environment With a Different Python Version on Windows | by David Littlefield | The Startup | Medium
🌐
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-b…
🌐
YouTube
youtube.com › watch
How to Change Default Python Version on Windows 10/11 (2023) - YouTube
In this video, I'll show you how you can change different python versions on windows. I have multiple python versions installed on my windows 11 and I'll cha...
Published   November 11, 2023
🌐
CircleCI
support.circleci.com › hc › en-us › articles › 16708605403035-How-to-Change-your-Python-Version-within-the-Windows-Executor
How to Change your Python Version within the Windows Executor – CircleCI Support Center
February 2, 2026 - ProblemIt is possible while we have a specific version of Python installed on our Windows Executor, your builds require something different instead. SolutionIf the version that you are looking for ...
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › dev-environment › python
Python on Windows for beginners | Microsoft Learn
February 26, 2026 - When the configuration starts, a terminal window shows the setup steps and required installs. Review them, then confirm by selecting [Y] Yes or [N] No to continue. The required workloads are installed. Verify your setup by running python --version.
🌐
H2S Media
how2shout.com › home › coding › set python 3 as your default “python version” on windows 10/11
Set Python 3 as your default "Python Version" on Windows 10/11
January 17, 2023 - Learn how to resolve multiple Python version issues by making Python 3 as the default one on Windows 10 or 7 via Environmental variables.
🌐
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

🌐
Medium
medium.com › @codelancingg › how-to-downgrade-python-version-windows-102a4b87105b
How to Downgrade Python Version Windows | by Codelancing | Medium
February 18, 2024 - Let’s walk through the process with an example: 1. Download the Desired Python Version: Visit the official Python website at https://www.python.org/downloads/release/. On this page, you will find a list of Python releases.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-update-python-on-windows
How to update Python on Windows? - GeeksforGeeks
July 23, 2025 - In this article, we are going to see how to update Python in the Windows system. For the sake of example, we will be upgrading from Python 3.6.8 to Python 3.9.6. Here, we will see how to upgrade the Python version.
🌐
GitHub
github.com › pyenv-win › pyenv-win
GitHub - pyenv-win/pyenv-win: pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well. · GitHub
To view a list of python versions supported by pyenv windows: pyenv install -l · To filter the list: pyenv install -l | findstr 3.8 ... Note: An install wizard may pop up for some non-silent installs. You'll need to click through the wizard during installation. There's no need to change any options in it.
Starred by 7.1K users
Forked by 575 users
Languages   VBScript 53.7% | Python 30.9% | Batchfile 11.6% | PowerShell 3.7% | Shell 0.1%
🌐
Codegive
codegive.com › blog › change_default_python_version_windows.php
Change default python version windows
This tutorial will guide you through the process of changing the default Python version on Windows, covering various scenarios and best practices. Having multiple Python versions installed is common, but making sure the right one is used when you type python in your terminal can be tricky.