Files
gh-otoshek-claude-code-toolkit/skills/django-setup/platform-install/windows.md
2025-11-30 08:46:40 +08:00

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

Why this method:

  • Official releases from python.org
  • Includes pip automatically
  • Easy installation

Steps:

  1. Visit python.org/downloads
  2. Click "Download Python 3.13.x" button
  3. Run the downloaded .exe installer

⚠️ 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
  1. Click "Install Now"
  2. Wait for installation to complete
  3. 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:

  1. Open Microsoft Store app
  2. Search for "Python 3.13"
  3. Click "Get" or "Install"
  4. Wait for installation
  5. 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:

  1. Open Start Menu
  2. Search "Environment Variables"
  3. Click "Edit the system environment variables"
  4. Click "Environment Variables" button
  5. Under "User variables", select "Path"
  6. Click "Edit"
  7. Click "New"
  8. Add Python paths:
    • C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\
    • C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\Scripts\
  9. Click "OK" on all dialogs
  10. 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 --version shows 3.11+ (or py --version)
  • pip --version works (or py -m pip --version)
  • python -m venv test_venv creates 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):

Install Git for Windows:

Install VS Code:


← Back to django-project-setup