Install the new Python 3.x release side-by-side (using the official Windows installer from python or winget install Python.Python.3.x), switch versions cleanly via the Windows Python Launcher (py -3.x), and recreate your project virtual environments from requirements.txt rather than overwriting or deleting your existing Python installation first.
Basic Example
# 1. Export current global packages (if any) before upgrading
python -m pip freeze > backup_requirements.txt
# 2. Install the new Python minor version side-by-side via Windows Package Manager (winget)
# (Or download the 64-bit Windows installer from [https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/))
winget install --id Python.Python.3.13 -e --source winget
# 3. Verify both old and new versions coexist cleanly via the Windows Python Launcher (`py`)
py --list
# Output:
# -V:3.13 * Python 3.13 (64-bit)
# -V:3.11 Python 3.11 (64-bit)
# 4. Recreate your project's virtual environment using the new interpreter
py -3.13 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
Key Details & Edge Cases
- Minor version upgrades (
3.11$\rightarrow$3.13) NEVER auto-upgrade in place on Windows:- Windows treats each
major.minorrelease (Python 3.11,Python 3.12,Python 3.13) as a completely separate installation directory (%LocalAppData%\Programs\Python\Python313\). Patch releases (3.13.0$\rightarrow$3.13.2) update in place when you run the matching3.13.xinstaller, whereas new minor releases install alongside older ones.
- Windows treats each
- Existing virtual environments (
.venv) break if you uninstall the old Python version:- A Windows
.venvcontains hard links/symlinks andpyvenv.cfgpointers tied directly to the exactpython.exepath it was created with. Always recreate virtual environments (rmdir /s /q .venvthenpy -3.13 -m venv .venv) before uninstalling the old Python version from Settings $\rightarrow$ Apps $\rightarrow$ Installed apps.
- A Windows
- Check
"Add python.exe to PATH"and"Install py launcher"in thepythoninstaller:- If you use the GUI installer from
python, select “Add python.exe to PATH” on the first screen (or click Customize installation $\rightarrow$ check py launcher and Disable path length limit at the end to preventMAX_PATH260-character errors duringpip install).
- If you use the GUI installer from
- Avoid the Microsoft Store Python alias trap (
App execution aliases):- Windows 10 ships with stub
python.exe/python3.exeshims inLocalAppData\Microsoft\WindowsAppsthat open the Microsoft Store or shadow your newpythoninstallation if placed higher inPATH. Ifpython --versionstill reports an older version after installing, verify yourPATHorder withwhere pythonin Command Prompt / PowerShell or disable the stub aliases under Settings $\rightarrow$ Apps $\rightarrow$ App execution aliases.
- Windows 10 ships with stub
- Verify third-party C-extension wheel compatibility before deleting your old Python:
- Brand-new Python releases (e.g., within weeks of a
3.x.0launch) may temporarily lack prebuilt binary wheels for heavy packages liketorch,scipy, ornumpy, forcing slow source compilations. Keeping your previous Python installed side-by-side lets you runpy -3.11immediately if a dependency isn’t ready yet.
- Brand-new Python releases (e.g., within weeks of a
Comparison of Windows 10 Python Upgrade Methods
| Upgrade Method | Side-by-Side Coexistence? | Updates PATH & py Launcher? |
Keeps Existing .venvs Working? |
Best Used When |
|---|---|---|---|---|
python Official Installer (Recommended) |
Yes (separate Python3X folder) |
Yes (check "Add python.exe to PATH") |
No (recreate .venvs with py -3.X -m venv .venv) |
Full control over custom install path, py launcher, and MAX_PATH disable toggle. |
winget install Python.Python.3.X |
Yes | Yes | No (recreate .venvs) |
Fast, scriptable command-line installation on Windows 10 (1809+) without browser downloads. |
uv python install 3.13 |
Yes (managed independently by uv) |
Manages per-project .venvs automatically |
No (recreate .venv via uv venv -p 3.13) |
Developers managing multiple Python versions per project without touching system PATH. |
| Microsoft Store Python | Yes (sandboxed app container) | Uses WindowsApps execution aliases |
No | Avoid for serious development—sandboxed filesystem paths frequently break pip, venv, and IDEs. |
You must log in or register to comment.
