|

How To Run Multiple Python Versions On Windows (2026)

Quick answer

  • Use the Python install manager: py list –online 3.15 shows versions you can add, py install 3.15 adds one, py list shows what you have, and py -V:3.15 runs that version for a single command.
  • The default runtime is the latest stable release unless you set the PYTHON_MANAGER_DEFAULT environment variable or a default_tag in the configuration file.
  • An active virtual environment overrides the default, so activate each project environment instead of switching the global default.

Applies to: Python install manager on Windows, as described in the Python 3.15.2 documentation

This guide is for anyone who needs two or more Python versions on one Windows PC, for example because an older project needs a different release than a new one.

The Python install manager is built for this, because it keeps several runtimes side by side and lets you pick one with a short flag.

The commands below come from the official “Using Python on Windows” documentation page, read on November 29, 2026.

Table of Contents

Quick answer: the commands you need

TaskCommand
See what is installed and the defaultpy list
See versions you can installpy list --online 3.15
Install another versionpy install 3.15
Run a specific versionpy -V:3.15 my-script.py
Remove one versionpy uninstall <TAG>

These work only after the install manager is on the PC, so if python or py is not found, start with our guide to fixing Python not recognized on Windows.

Step 1: list what you already have

py list

This shows the runtimes the manager can find, and the documentation says it also shows which one is your default.

Useful options on the same command are listed below.

OptionWhat the documentation says
--one or -1Shows the single best result
--only-managedLeaves out runtimes the manager did not install
--onlineSearches the online index for runtimes you can install
-f or --formatSets the output format, such as table, csv or json

Step 2: install another version

First search the online index, using the example form from the documentation.

py list --online 3.15

Then install the tag you want, using the documented form py install <TAG>.

py install 3.15

The documentation shows other tags as examples, such as 3.15t for the free-threaded build, and says PythonCore is the recommended standard CPython variant.

Run py list --online yourself for the tags available today, because the examples on the page are for version 3.15.

Two install options help when you repeat the command.

  • --update replaces an install only if the new version is newer, and with no tags it updates every managed install.
  • --force ignores cached files and replaces an existing install.

Step 3: run a specific version

Put the version flag before everything else on the command line.

py -V:3.15 my-script.py

The documentation says the -V:<TAG> flag must come before any other option.

It adds that the V: part may be omitted when the tag refers to an official release and starts with 3, for compatibility.

The same flag works with other tag forms shown on the page, such as py -V:3-arm64 for an ARM build.

Change which version is the default

With no flag, py and python use the default runtime, which is the latest stable release unless you configured otherwise.

The documentation gives two ways to change that.

MethodWhere
Environment variablePYTHON_MANAGER_DEFAULT
Configuration fileThe default_tag setting, in the user file %AppData%\Python\pymanager.json

You can set the environment variable from Start by searching for Edit environment variables for your account, as in our guide to editing environment variables in Windows 11.

Run py list again afterwards to confirm the default changed.

Why the wrong version starts

The documentation explains two rules that surprise people with several installs.

  • Managed installs, the ones added with py install, are chosen ahead of unmanaged ones.
  • Unmanaged prereleases may be chosen ahead of stable releases.

Its fix is to use py install for the version you want, or to set your default tag, or to uninstall the prerelease and reinstall with py install.

Use virtual environments per project

The documentation recommends a virtual environment for each project, created with the command below.

python -m venv <env path>

Activate it with <env>\Scripts\Activate, and the page says that when no version is requested an active virtual environment becomes the default runtime.

This is often easier than changing the global default, because each project keeps the version it was created with.

Pick a version inside a script

The documentation says the manager reads a shebang line at the top of a script, such as the one below, and launches the matching runtime.

#! /usr/bin/python

It warns that shebang handling is subtly different from the older py.exe launcher, and that the old py.ini options no longer apply.

That is a reason to move version choices into the default tag or the -V: flag rather than old launcher settings.

Remove a version you no longer need

py uninstall <TAG>

For removing everything, see our guide to uninstalling Python completely on Windows.

Source

Leave a Reply

Your email address will not be published. Required fields are marked *