If You have python of the same version with different subversion e.g. 2.6, 3.7,.. 3.9.
Use the below command to open specific python version's terminal in command prompt:

py -2.6
py -3.7
.

for installing modules in command prompt:

py -2.6 -m pip install <modules>
py -3.7 -m pip install <modules>
Answer from NevetsKuro on Stack Overflow
Discussions

How Should I Set Default Python Version In Windows? - Stack Overflow
Just don't add any of them to the path and use the Python launcher. Why edit the path every time you switch? You can also create virtual environments with the installed python of choice with "py -x.y -m venv " where x.y is the Python version (must already be installed). 2021-01-10T18:52:23.64Z+00:00 ... Note that if you are installing using Windows ... More on stackoverflow.com
🌐 stackoverflow.com
Managing multiple python versions on Windows
Use the py launcher, if you run ‘py -0’ you should get a list of the pythons installed, you can select the one you want to use by doing ‘py -3.10 main.py’ , ‘py -3.13 -m pip install …’ and so on More on reddit.com
🌐 r/learnpython
7
6
March 18, 2025
How to set multi Python version environment to easy switch
How to install different versions of Python and easy to switch it, Thanks! More on learn.microsoft.com
🌐 learn.microsoft.com
2
0
February 21, 2023
Managing multiple python version without any tool
Does Python officially recommend any tool to manage different python version? How complex would that be if I try to do it myself manually? For example, I could just have different python version on my system, and use their fully specified path just to start a local environment. More on discuss.python.org
🌐 discuss.python.org
7
0
March 15, 2024
🌐
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
commands List all available pyenv commands local Set or show the local application-specific Python version latest Print the latest installed or known version with the given prefix global Set or show the global Python version shell Set or show the shell-specific Python version install Install 1 or more versions of Python uninstall Uninstall 1 or more versions of Python update Update the cached version DB rehash Rehash pyenv shims (run this after switching Python versions) vname Show the current Python version version Show the current Python version and its origin version-name Show the current Python version versions List all Python versions available to pyenv exec Runs an executable by first preparing PATH so that the selected Python version's `bin' directory is at the front which Display the full path to an executable whence List all Python versions that contain the given executable
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%
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.

🌐
Medium
medium.com › @diego.coder › installing-multiple-versions-of-python-on-windows-with-pyenv-2959bd91a48c
Easily Install Multiple Python Versions on Windows with Pyenv 😎🐍 | by Code & Chill | Medium
February 13, 2025 - Pyenv is a tool that simplifies the management of multiple versions of Python on a system. With Pyenv, you can install multiple versions of Python and switch between them as needed. In addition, Pyenv gives you the ability to create virtual environments for specific projects, which helps keep ...
🌐
Reddit
reddit.com › r/learnpython › managing multiple python versions on windows
r/learnpython on Reddit: Managing multiple python versions on Windows
March 18, 2025 -

I've coded a bit in Python for years, and had an existing installation of 3.10.7 which I installed using Chocolatey some time ago.

Then I thought I would play with WhisperX. The tutorial I found walked me through installing Anaconda, which I did not realize would install a second copy of Python, this time 3.12. It broke a couple of existing projects, and so I gave up on WhisperX and swapped the PATH variable back to the 3.10 installation.

Then, last week, I read about Gemma3 and thought I might experiment with that. I found a blog post -- can you see where this is going? -- that pointed me to Ollama. Which I installed, once again not realizing it would install yet another copy of Python, this time 3.13. It didn't break my projects this time, but I think that's because the user-level PATH variable is still pointing at 3.10 while the system-level PATH variable is pointing at 3.13. Oh, and I never got Gemma3 up and running, possibly because it doesn't like 3.10.

So now I have three copies of Python installed, they're fighting with one another over the PATH variable, and I still haven't gotten to experiment with local AI stuff. There's got to be a better way to manage these things.

My googling so far has pointed me at pyenv, which as far as I can tell is a Linux-only utility. I think. I love me some Linux, but the machine in question is a Windows box. Is there some obvious utility I should be using for swapping back and forth between versions that I'm just not finding?

🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1182826 › how-to-set-multi-python-version-environment-to-eas
How to set multi Python version environment to easy switch - Microsoft Q&A
February 21, 2023 - What this does under Windows, is to trawl the %PATH% environment variable, checking for an executable, either batch file (.bat), command file (.cmd) or some other executable to run (this is controlled by the PATHEXT environment variable), that matches the name given. When it finds the correct file to run the file is being run. Now, if you've installed two python versions 2.5 and 2.6, the path will have both of their directories in it, something like PATH=c:\python\2.5;c:\python\2.6 but Windows will stop examining the path when it finds a match.
Find elsewhere
🌐
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 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?

🌐
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 - - run: name: installed version verification shell: bash command: | py -3.9 -m venv venv39 source ./venv39/Scripts/activate python --version
Top answer
1 of 3
1

Here's my discoveries.

Step 1. Go to System Properties. Click on Environment Variables

Step 2. Add new variables, such as PYTHON_27_HOME

  • PYTHON_27_HOME:%ProgramFiles%\Python27\
  • PYTHON_36_HOME:%ProgramFiles%\Python36\
  • PYTHON_HOME:%PYTHON_27_HOME%

In my case, PYTHON_27_HOME(Python 2.7) is pointing to C:\Program Files\Python27\. You can replace this with your own path to python. %PYTHON_HOME% has a default value pointing to %PYTHON_27_HOME%, which is the path for Python 2.7. That's my preference, feel free to adjust accordingly. Be aware that there're 32-bit and 64-bit python. Please use %PROGRAMFILES% for path to C:\Program Files and %PROGRAMFILES(X86)% for path to C:\Program Files (x86).

Step 3. Select PATH and click on Edit. PATH

Step 4. Click on New and add %PYTHON_HOME%. %PYTHON_HOME% will be added to PATH automatically every time you launch a command prompt.


In order to switch between different versions of python in cmd, here's the trick.

Step 5. I created a batch file with

@echo off
:: Switch Python version
DOSKEY python27=SET PATH=%PYTHON_27_HOME%;%PATH%
DOSKEY python36=SET PATH=%PYTHON_36_HOME%;%PATH%

Basically, it disables echo and creates two alias. In batch file any string after :: is the comments. Every time, python27 or python36 is called, it re-exports %PATH% with the new Python path. Save it as profile.bat. You can name it whatever you want.

Step 6. Search for regedit (Registry Editor). Click on Edit > New > String Value. Give AutoRun as the Value name and %USERPROFILE%\profile.bat as the Value data. Here, please put your actual path value to the profile.bat we just created. So, whenever a command prompt is opened, it automatically loads profile.bat, which creates those two alias in the script.

Step 7. Close any command prompt you're using or just open a new command prompt. This is because your changes will not affect opened cmd window. Environment changes only happens to new CMD.

Step 8. Verify your results here.

If you're using different Java versions, same trick applies, too. Find my javac environment setting here.

2 of 3
1

I think the easiest way to support various versions of Python, as well as other languages, is the asdf version manager. It allows you to set a version of Python globally, as well as in each project folder. This means that you can set your Python version to dynamically change based upon the folder you're working in.

asdf version manager

I haven't used Windows for almost 20 years, but I've heard that Windows 10 sports an Ubuntu-based subsystem for Linux. I don't know if asdf will work with that, but it is worth a try. Just use the instructions for setting asdf up with bash.

🌐
Real Python
realpython.com › intro-to-pyenv
Managing Multiple Python Versions With pyenv – Real Python
September 1, 2025 - This global command sets 3.13.5 as the Python version you’ll get when you run the python command in any terminal window. If you ever want to go back to the system version of Python, then you can run the command below: ... You can now quickly switch between different versions of Python, which ...
🌐
YouTube
m.youtube.com › watch
How to Switch Python Versions on Windows 10/11 (2023)
Share your videos with friends, family, and the world
Published   November 12, 2023
🌐
NAO IT Systems LLC.
digibeatrix.com › home › environment & package management › easily switch python versions on windows, macos, and linux
Easily Switch Python Versions on Windows, macOS, and Linux - Practical Python Programming
November 29, 2025 - If you want to change the default Python version, update the Python executable path in Windows’ Environment Variables settings. This makes the python command point to the version you specify. On macOS and Linux, you can use a tool called pyenv to easily install, manage, and switch between multiple Python versions.
🌐
Iditect
iditect.com › faq › python › how-to-run-multiple-python-versions-on-windows.html
How to run multiple Python versions on Windows
The "py" launcher on Windows allows you to specify the desired Python version using a version-specific prefix, enabling easy switching between multiple Python versions from the command line.
🌐
DEV Community
dev.to › kiani0x01 › how-to-switch-python-versions-2o8e
How to Switch Python Versions - DEV Community
July 28, 2025 - Easily switch between Python versions on Windows, macOS, and Linux using tools like pyenv, the py launcher, and virtual environments.