Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

Prerequisites

  • Windows 10 or Windows 11 (x64, arm64, or x86)
  • PowerShell 7.x (pwsh.exe) in PATH
    winget install Microsoft.PowerShell
    

Note: Administrator privileges are never required. All registry keys, PATH entries, and environment variables are scoped strictly to the current user (HKCU / User).


First Installation (Interactive)

  1. Extract the release .zip (or clone the repository) to a folder of your choice.
  2. Run main.bat and select 1. Download & Install Portable Python.
  3. The manager queries https://www.python.org/ftp/python/index-windows.json and displays available official PythonCore releases with Latest Stable listed as Option 1 ([DEFAULT]):
    • Press Enter to install Latest Stable.
    • Enter a menu number (1-10) to install a specific minor line.
    • Type b 3.14 (or b 3.14t) to browse individual patch releases in that minor line.
    • Type an exact version or spec (e.g., 3.13.17, freethreaded, prerelease).
  4. Confirm or customize the target folder (e.g., D:\CLI\Python).
  5. The manager downloads the official ZIP, verifies its SHA-256 hash, extracts it, initializes <InstallDir>\data\, bootstraps pip offline via ensurepip, and configures User PATH, portable env vars, and PEP 514 HKCU registry keys.
  6. Open a new terminal window and verify:
    python --version
    pip --version
    

Portable Directory Layout

All mutable user state stays inside <InstallDir>\data\ and is preserved across in-place updates:

<InstallDir>\
├── python.exe / pythonw.exe
├── Scripts\                       (pip.exe & installed CLI scripts)
├── Lib\site-packages\
│   └── sitecustomize.py           (auto-managed zero-leak portability fallback)
├── python-portable.json           (manager metadata)
└── data\                          (preserved across all in-place updates)
    ├── pip.ini                    (PIP_CONFIG_FILE)
    ├── pip-cache\                 (PIP_CACHE_DIR)
    ├── user-site\                 (PYTHONUSERBASE)
    ├── venvs\                     (WORKON_HOME)
    └── python_history             (PYTHON_HISTORY)

Side-by-Side Installations

Use {minor} in config.ini (or pass -TargetDir) to keep multiple Python versions installed simultaneously:

pwsh -File src\install.ps1 -Version 3.14 -TargetDir "D:\CLI\Python-3.14"
pwsh -File src\install.ps1 -Version 3.13 -TargetDir "D:\CLI\Python-3.13"

# Switch active version (updates User PATH, portable env vars, and PEP 514 registry)
pwsh -File src\configure.ps1 -Mode SwitchActive -TargetDir "D:\CLI\Python-3.13"