Get started with the new Python Installation Manager

Python is a first-class citizen on Microsoft Windows. That means you can install and remove the Python interpreter like any other application, and run multiple versions of the interpreter side-by-side using the py tool.

But there’s been one long-standing weakness: While you have a central way to select which of your installed versions of Python to use for a given task, you can’t actually manage the installed versions.

Python’s core development team has developed a new tool, the Python Installation Manager for Windows, to handle both of these functions: managing installed versions of Python, and choosing which version to use when launching Python. It’s currently only available as a pre-release, but as of Python 3.16, it’s intended to become the preferred way to manage and select Python installations in Windows.

This article is a quick guide to getting started with the Python Installation Manager.

Setting up the Python Installation Manager

The Python Installation Manager is itself just another Windows app, so there are a few ways to install it:

  • The Microsoft Store app offers a convenient one-click installation method.
  • The official Python site offers a direct download, although this link is somewhat obscure and likely to change with each new release.
  • You can also use the WinGet package manager: winget install 9NQ7512CXL7T. (Note that in the future, this alias may be changed to something more readable.)

Python Installation Manager replaces ‘py’

If you used the earlier incarnation of the py tool for Python to manage Python versions, the Python Installation Manager eclipses its functionality. Typing py will now bring up the Python Installation Manager, although all the commands you used with py before will still work.

If you want to see for yourself how things are different, open a command line and type py help. You’ll see the command list for the Python Installation Manager:

Python Installation Manager help options

IDG

In the original py launcher, this command would have given an error. Now, it provides details about all the available command-line options for the Python Installation Manager.

Adding and removing Python versions

To see which versions of Python are already present in your system, type py list:

Python Installation Manager listing versions of installed Python.

IDG

If you had Python instances installed before you set up the Python Installation Manager, you’ll be able to see them, but you won’t be able to change anything. If you want to make changes, you’ll need to manually remove the old instances (through the Apps pane in your Windows settings), then re-install them using the Python Installation Manager.

In this case, the Python 3.14 instance shown in green (at the top of the screen) is managed by the Python Installation Manager; the others were added by hand earlier.

Adding a version of Python is a simple command: py install :

Python Installation Manager installing Python version 3.11.

IDG

Once installed, you can invoke that version by typing py -:

Running Python 3.11 with the Python Installation Manager.

IDG

Removing a managed version of Python is equally simple: py uninstall :

Removing Python 3.11 with the Python Installation Manager.

IDG

To see which versions of Python are available through the manager, use py list --online. You can also export the listed Python installations as JSON if you want to feed it to other programs: py list -f=json. (CSV and JSONL formats are also available.)

Setting the default Python

When you list the available Python installations, one will typically be marked with an asterisk:

The default version of Python (3.14) is shown with an asterisk in the Python Installation Manager..

IDG

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. As an example, to set 3.12 as the default in PowerShell, you’d type:

$Env:PYTHON_MANAGER_DEFAULT="3.12"

After you set this, Python 3.12 will be listed as the default.

The new default version of Python (3.12) is shown with an asterisk in the Python Installation Manager.

IDG

The pymanager alias

It’s possible that a command like py install would clash with the name of a preconfigured command in a virtual environment, or with some other alias. To avoid that, you can use pymanager as an unambiguous name for the Python Installation Manager. All the commands remain the same; only the name of the executable is different.

Running the Python Installation Manager with the "pymanager" alias instead of "py".

IDG

Setting Python app aliases for Windows

A possible final step is to configure the Windows app execution aliases for commands like python and python3. To do that, type py install --configure. You’ll then get a prompt to modify your system’s app execution aliases:

The prompt to manage Windows app execution aliases from the Python Installation Manager.

IDG

Typing “Y” opens the app execution aliases window in Settings. From there, you can change how python and python3 behave. If you toggle them off, as shown, they will no longer launch anything at the command line, but you can use py and pymanager to launch Python.

That’s about it. One last thing worth noting is that we still have an active alias for pythonw and pyw. Those are special-case versions of the Python runtime that execute without a console session:

Windows app execution aliases pane, showing Python aliases.

IDG

Total
0
Shares
Previous Post

Managing software projects is a double-edged sword

Next Post

10 JavaScript concepts you need to succeed with Node