How to Update Python in CMD on Windows

To update Python in Windows Command Prompt, use the Python install manager to update an installed runtime or install the newer release you need. Then verify which interpreter CMD launches, because installing a new version does not necessarily replace the Python your projects use. The steps below cover installation, version selection, virtual environments, and fixes for CMD still showing an older version.

What Updating Python in CMD Changes

Updating the Python interpreter and updating its packages are separate operations. The interpreter runs your code; packages add functionality to that interpreter.

Windows does not include a system-supported Python installation. The Python install manager is the CPython team’s tool for obtaining and managing Python on Windows.

There are two different update tasks:

  • Updating an existing release family: Get a newer maintenance release without changing the major and minor version your project targets.
  • Moving to a newer release family: Install another interpreter, then check that your application and dependencies support it.

The manager handles runtimes it installs. It does not automatically convert a Python installation created by an older installer or another distribution into a managed installation. Those installations can coexist, which makes checking the selected interpreter important.

These instructions are for standard CPython in Windows CMD, not Python inside WSL, Docker, or a Conda environment.

How to Update Python From Command Prompt

The Python install manager can update managed runtimes or install a selected release family from Command Prompt.

Step 1: Check Your Current Python Installation

  1. Open Command Prompt from Start. Run these commands at the Windows prompt, not at Python’s >>> prompt. If you are inside the Python interpreter, exit it first:
    exit()
  2. Check the Python version CMD currently selects:
    python --version
  3. Check whether the Python install manager is available and list installed runtimes:
    py list

If the first command returns a version, Python is available through that command. If it opens the Microsoft Store or reports that Python cannot be found, you may have only an app execution alias rather than a working interpreter.

The runtime-list command should display installed Python runtimes. An error about opening a file named list usually means the older Python launcher, not the install manager, is handling the command.

Step 2: Install the Python Install Manager if Needed

If the runtime-list command works, you do not need to reinstall the manager.

  1. Otherwise, install the Python install manager through WinGet:
    winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity

    This installs the manager; you will choose and install the Python runtime separately. If WinGet is unavailable, download the Python install manager from python.org/downloads or obtain it through the Microsoft Store. For Windows Server 2019, use the Python install manager’s MSI installer; confirm your Windows version under Settings > System > About.

  2. If an error about a file named list indicates that the legacy launcher is taking priority, open Settings > Apps > Installed Apps and uninstall the separate Python Launcher entry. Do not uninstall a Python runtime or the Python install manager.
  3. Close Command Prompt, open a new window, and confirm that the manager responds:
    py list

An empty runtime list is fine if you have not installed Python yet. The important result is that the command displays the manager’s runtime inventory rather than treating list as a script.

Step 3: Find the Python Release You Need

  1. List the runtimes available to install:
    py list --online

    Use this output to confirm available tags instead of assuming a version mentioned in a tutorial is still the newest release. For normal development, choose a stable release supported by your project’s dependencies, rather than a preview or specialized runtime variant.

  2. To narrow the listing to a particular release family, use a version filter:
    py list --online 3.15

    The filtered output identifies matching runtime tags. Substitute the release family your project requires when using this example.

Choose the update operation based on your goal:

Your Goal Operation to Choose Effect on Existing Installations
Get maintenance updates for manager-installed runtimes Update managed runtimes Updates the existing release families rather than migrating projects to another family
Move to a newer release or install your first managed runtime Install or update a selected tag Makes that release available; older release families can remain installed

Step 4: Update or Install the Runtime

  1. Run one of these operations. To update all runtimes managed by the Python install manager:
    py install --update

    With no tags supplied, the update operation checks all managed runtimes. It does not mean “move every project to the newest Python release.” To install a selected release family, or update it if it is already managed:

    py install --update 3.15

    Use the tag you selected from the online listing. The update option replaces an existing managed installation when a newer matching version is available.

  2. Let the installation finish successfully before checking the result. If installation fails, do not remove the working interpreter: resolve the reported download, permission, or installation error first.

Step 5: Verify the Installed Version and CMD’s Default

  1. Check the updated inventory:
    py list
  2. Verify the example release explicitly:
    py -V:3.15 --version

    Version selection avoids relying on whichever interpreter the plain Python command currently finds. Use an installed tag from the runtime inventory when targeting a different release.

  3. Check the default command separately:
    python --version

When the manager’s global python command is in use, with no active virtual environment or configured default override, it launches the latest installed Python version. That selection can change when runtimes are added or removed.

If the explicit version check succeeds but the default command reports something else, installation succeeded. The remaining issue is interpreter selection.

How to Move a Project to the New Python Version

A global Python update does not, by itself, migrate a project’s virtual environment. A virtual environment is tied to a particular base interpreter and has its own packages, isolated from the base installation by default, as documented in Python’s virtual environment documentation.

Recreate a Project’s Virtual Environment

For a move between release families, create a new environment rather than assuming an existing one will switch interpreters.

The example below assumes your current environment is named .venv. Open Command Prompt in your project directory, and substitute your actual environment directory if it has another name.

  1. Activate the existing environment:
    .venv\Scripts\activate.bat
  2. Export its installed packages to a separate migration file:
    python -m pip freeze > requirements-migration.txt

    This records the current package versions without overwriting a curated requirements.txt. If your project uses a dependency manager and lockfile, use that project’s dependency workflow when rebuilding instead.

  3. Leave the old environment:
    deactivate
  4. Create a new environment using the chosen interpreter explicitly:
    py -V:3.15 -m venv .venv-new

    Use a new directory so the original environment remains available while you test.

  5. Activate the new environment:
    .venv-new\Scripts\activate.bat
  6. Reinstall the recorded dependencies:
    python -m pip install -r requirements-migration.txt

    Some pinned packages may not support the newer interpreter. If installation fails because of compatibility, update the affected dependency constraints deliberately; do not copy the old environment’s site-packages directory into the new one.

  7. Confirm the environment’s Python version:
    python --version
  8. Confirm that pip belongs to the new environment:
    python -m pip --version

    The reported pip location should be inside .venv-new.

Finally, select .venv-new\Scripts\python.exe as the interpreter in your editor or IDE and run the project’s normal tests or application checks. Keep the old environment and its base interpreter until those checks pass. Leave the new environment at the path where you created it; moving or renaming virtual environments can break their scripts.

Install Packages Into a Specific Base Interpreter

For packages installed outside a virtual environment, select the interpreter explicitly instead of relying on an unrelated pip executable on PATH.

This example targets an installed Python 3.14 runtime; replace SomePackage with the actual package name:

py -3.14 -m pip install SomePackage

Confirm that the package is installed in that interpreter:

py -3.14 -m pip show SomePackage

The version selector must match an installed runtime tag. For a project environment, use its activated interpreter instead so the packages stay isolated from other projects.

Fix Python Still Showing the Old Version

If the requested runtime is installed but CMD launches another one, diagnose command selection before reinstalling anything.

  1. Leave an active virtual environment if you intend to check global Python. An environment intentionally takes precedence over the base installation. If one is active, run:
    deactivate

    A fresh Command Prompt opened from Start also gives you a clean place to check the global installation.

  2. Find the executables Windows can locate.
    where python

    Multiple results indicate multiple matching command locations. An older installation directory may appear before the manager’s app-alias location.

  3. Identify the interpreter that actually starts.
    python -c "import sys; print(sys.executable)"

    This prints the running interpreter’s path. If the command opens the Store instead, correct the app execution aliases before repeating the check.

  4. Correct PATH when an old installation takes priority. Search Start for Edit environment variables for your account, then select Path > Edit under your user variables. The manager’s Windows app aliases normally rely on %LocalAppData%\Microsoft\WindowsApps being on PATH. Remove obsolete Python entries that you no longer need, or adjust the relevant PATH entries so the intended command resolves first. Do not delete installation folders as a shortcut. Check both user and system PATH entries if an older installation still takes precedence. A system-level change may require administrator permission.
  5. Correct aliases if Python opens the Microsoft Store. Search Windows Settings for App execution aliases. Enable the Python install manager’s python.exe alias, and disable a conflicting App Installer Python alias if one is present. Do not disable every Python alias indiscriminately, the manager uses aliases to expose its commands.
  6. Open a fresh Command Prompt and confirm both the version and executable path.
    python -c "import sys; print(sys.version); print(sys.executable)"

The version should now be the one you intended to run, and the executable path should belong to the corresponding installation. If you intentionally keep a different global default, use a version-selected launcher command for projects that need another release.

Confirm Your Python Update Is Ready for Development

A successful installer message confirms only that a runtime was installed. Before using it for ongoing development, check that:

  • The runtime is available: An explicit version-selected launch reports the intended release.
  • CMD selects the expected interpreter: The default command’s executable path matches your intended installation.
  • The project uses the new environment: Its interpreter and pip location belong to the environment you created.
  • Dependencies install successfully: There are no unresolved package compatibility errors.
  • The application works: Your normal tests or application checks pass under the new interpreter.

For reproducible development, record the supported Python release in your project configuration or setup documentation. Select the new interpreter in your editor, then run the project’s normal development workflow before changing shared deployment settings.

Frequently Asked Questions

Can I Update Python With Pip?

No, pip installs and updates Python packages, not the Python interpreter. To upgrade pip itself for the interpreter selected by your current shell, run:

python -m pip install --upgrade pip

Confirm the updated pip version and its installation location afterward:

python -m pip --version

How Do I Install Python 3.13 in Command Prompt?

With the Python install manager installed, use this command to install the requested release family or update an existing managed installation:

py install --update 3.13

Verify that runtime explicitly rather than relying on the default interpreter:

py -V:3.13 --version

Do I Need to Uninstall the Old Python Version First?

No, different Python release families can remain installed side by side. Keep the older interpreter while you rebuild environments and test projects against the new one. Removing an interpreter that an existing virtual environment depends on can leave that environment unusable.