5.4 KiB
Python Installation - Windows
Check Current Version
PowerShell or Command Prompt:
python --version
If you see Python 3.11+, you're good to go! ← Back to main skill
Installation Methods
Option 1: Official Python Installer (Recommended)
Why this method:
- Official releases from python.org
- Includes pip automatically
- Easy installation
Steps:
- Visit python.org/downloads
- Click "Download Python 3.13.x" button
- Run the downloaded
.exeinstaller
⚠️ CRITICAL: Check "Add Python to PATH"
- This checkbox is at the bottom of the installer
- Must check this box or Python won't work from command line
- Click "Install Now"
- Wait for installation to complete
- Click "Close"
Verify installation:
python --version
pip --version
Option 2: Microsoft Store (Windows 10/11)
Why this method:
- Easiest installation
- Automatic PATH configuration
- Auto-updates through Microsoft Store
Steps:
- Open Microsoft Store app
- Search for "Python 3.13"
- Click "Get" or "Install"
- Wait for installation
- Restart terminal
Verify:
python --version
Option 3: Chocolatey Package Manager
Why this method:
- Command-line package management (like Homebrew on macOS)
- Good for automated setups
- Easy updates:
choco upgrade python
Install Chocolatey first:
Open PowerShell as Administrator and run:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Install Python:
choco install python --version=3.13.0
Verify:
python --version
Option 4: Scoop Package Manager
Why this method:
- Lightweight package manager
- No admin rights required
- Clean installations
Install Scoop:
irm get.scoop.sh | iex
Install Python:
scoop install python
Verify:
python --version
Configure PATH (If Python Not Found)
Check if Python is in PATH
Open Command Prompt and run:
where python
If nothing appears, Python is not in PATH.
Add Python to PATH Manually
Find Python installation location:
- Official installer:
C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\ - Microsoft Store:
C:\Users\<YourName>\AppData\Local\Microsoft\WindowsApps\
Add to PATH:
- Open Start Menu
- Search "Environment Variables"
- Click "Edit the system environment variables"
- Click "Environment Variables" button
- Under "User variables", select "Path"
- Click "Edit"
- Click "New"
- Add Python paths:
C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\Scripts\
- Click "OK" on all dialogs
- Restart terminal/PowerShell
Verify:
python --version
Troubleshooting
Issue: python: command not found
Solution 1: Use py launcher instead
py --version
py -m venv venv
Solution 2: Add to PATH (see section above)
Solution 3: Reinstall Python
- Uninstall current Python
- Reinstall and check "Add Python to PATH"
Issue: Multiple Python versions installed
List all versions:
py --list
Use specific version:
py -3.13 --version
py -3.13 -m venv venv
Issue: PowerShell Execution Policy Error
When activating venv:
venv\Scripts\Activate.ps1 : File cannot be loaded because running scripts is disabled
Solution:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Then retry activation:
venv\Scripts\Activate.ps1
Issue: pip not found
Use python -m pip instead:
python -m pip --version
python -m pip install --upgrade pip
Issue: Long path errors
Enable long paths in Windows:
Open PowerShell as Administrator:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Restart computer.
Using Windows Subsystem for Linux (WSL)
Alternative: Use Linux Python on Windows
Install WSL:
wsl --install
Install Ubuntu:
wsl --install -d Ubuntu
Then follow: linux-ubuntu.md for Python installation
Verification Checklist
python --versionshows 3.11+ (orpy --version)pip --versionworks (orpy -m pip --version)python -m venv test_venvcreates test environment- Can activate test venv:
test_venv\Scripts\activate - Prompt shows
(test_venv)prefix
Clean up test:
rmdir /s test_venv
Development Tools (Optional)
Install Windows Terminal (better than Command Prompt):
- Download from Microsoft Store
- Or: https://aka.ms/terminal
Install Git for Windows:
- Download from: https://git-scm.com/download/win
Install VS Code:
- Download from: https://code.visualstudio.com/