If you have ever installed Python on a fresh Windows machine, you know the frustration: you open PowerShell or CMD, type python, and instead of an interactive REPL, Windows opens the Microsoft Store. Or worse, you install Python through an installer, run a script, and face the infamous error:
'python' is not recognized as an internal or external command, operable program or batch file.
Installing Python on Windows doesn't need to involve clicking through twenty installer screens or manually navigating nested system menus to edit environment variables.
In this fast-paced companion guide, we will set up Python on Windows the modern way using Winget (the official Windows Package Manager), configure your PATH automatically, and fix common execution alias traps in under three minutes.
💡 Note: For an exhaustive, screenshot-rich walkthrough that covers the traditional GUI wizard, offline bundle installations, and VS Code integration, read the Complete Windows Python Guide on taha-heidaryfard.ir.
Step 1: The One-Command Installation via Winget
Windows 10 (modern builds) and Windows 11 ship with Winget pre-installed. Instead of downloading .exe files from a browser, open PowerShell as Administrator and search for available Python releases:
winget search Python.Python To install the latest official Python 3 release and automatically prepend it to your system PATH, run:
winget install -e --id Python.Python.3.12 --override "/passive PrependPath=1" Why the --override Flag Matters
When running standard silent or GUI installers, the checkbox "Add python.exe to PATH" is unchecked by default. Passing /passive PrependPath=1 tells the installer engine to write the executable paths directly to your environment variables during setup.
Step 2: Verify Your Installation & Dodge the Store Trap
Close your terminal and open a fresh PowerShell prompt (environment variable updates only apply to newly launched shells). Verify that Python is responding:
python --version pip --version The Windows Store Redirect Trap
If typing python still opens the Microsoft Store, Windows has hijacked the command with an empty "App Execution Alias". You can deactivate this in seconds:
- Press
Win + Sand type Manage app execution aliases. - Scroll down until you see App Installer (python.exe) and App Installer (python3.exe).
- Toggle both OFF.
Alternatively, Windows includes the Python Launcher (py), which avoids alias conflicts altogether:
py -3 --version py -m pip install --upgrade pip Step 3: Troubleshooting the "Command Not Recognized" PATH Error
If you installed Python without the PrependPath flag, your shell cannot locate the executable. Here is how to fix it without touching the control panel.
1. Locate Where Python Was Installed
Standard user-level installations on Windows reside in:
C:\Users\<YourUsername>\AppData\Local\Programs\Python\Python312\ C:\Users\<YourUsername>\AppData\Local\Programs\Python\Python312\Scripts\ (The Scripts folder is essential because tools like pip, pytest, black, and uvicorn live there).
2. Append Python to User PATH via PowerShell
Run this snippet in PowerShell (replace YourUsername and version folder if different):
$pythonPath = "$env:LOCALAPPDATA\Programs\Python\Python312" $scriptsPath = "$pythonPath\Scripts" $userPath = [Environment]::GetEnvironmentVariable("Path", "User") if ($userPath -notlike "*$pythonPath*") { $newPath = "$userPath;$pythonPath;$scriptsPath" [Environment]::SetEnvironmentVariable("Path", $newPath, "User") Write-Host "PATH successfully updated! Restart your terminal." -ForegroundColor Green } Step 4: Best Practice — Isolate Projects with Virtual Environments
Never install application dependencies directly into your global system Python. Always initialize an isolated environment:
# Create a dedicated directory mkdir my-python-project cd my-python-project # Initialize virtual environment python -m venv .venv # Activate it in PowerShell .\.venv\Scripts\Activate.ps1 (Note: If PowerShell throws an execution policy error, enable local script execution with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser).
What’s Next?
With a clean, command-line-accessible Python environment configured, you are ready to start building scripts and applications.
If you want to move beyond terminal utilities and build graphical desktop applications, check out our guide on What is Tkinter and Python GUI Guide to see how Python's built-in GUI toolkit works.
For a deeper dive into multi-version side-by-side management, VS Code terminal integration, and enterprise configurations, head over to the primary tutorial:
👉 Install Python on Windows using Winget
Originally published at taha-heidaryfard.ir.


![Cargo UAV Autonomy and Flight AI — Ch.06: Route Planning and Airspace Integration [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F54s7rrr8fw0ipjpci49u.png)