Python on Windows: Version Selection and Elegant Workflows

Summary
A comprehensive guide to choosing the right Python version and setting up an elegant Python development environment on Windows using modern tools like uv.

Introduction

Python is one of the most popular programming languages in the world, powering everything from web applications to scientific research and machine learning. However, setting up Python on Windows can be surprisingly tricky — especially when you need to manage multiple versions or avoid common pitfalls.

This post addresses two fundamental questions every Windows Python developer faces:

  1. Which Python version should I choose?
  2. How do I install and manage Python elegantly on Windows?

By the end of this guide, you’ll have a clean, professional Python setup that avoids the classic “it works on my machine” problems.

Philosophy: The Three Isolations

Before diving into tools and commands, let’s understand what makes a Python setup “elegant.” The key principle is isolation at three levels:

  1. Python Version Isolation: Multiple Python versions (3.11, 3.12, 3.13) coexist without interference
  2. Project Environment Isolation: Each project has its own dependencies, completely independent from others
  3. System Isolation: Your development environment never pollutes Windows system files or registry
graph LR
    subgraph "❌ The Inelegant Way"
        A["Global Python"] --> B["Project A"]
        A --> C["Project B"]
        A --> D["Project C"]
        B -.->|"Dependency Conflict!"| C
    end
graph LR
    subgraph "✅ The Elegant Way"
        E["Python 3.11"] --> F[".venv A"]
        G["Python 3.12"] --> H[".venv B"]
        G --> I[".venv C"]
    end

The tools we’ll introduce — particularly uv — achieve all three isolations effortlessly.

Choosing the Right Python Version

Understanding Python’s Release Cycle

Python follows a predictable release schedule. Each minor version (e.g., 3.11, 3.12, 3.13) receives:

  • Full support for 18 months after release
  • Security updates for an additional 3.5 years
  • End of life roughly 5 years after initial release
gantt
    title Python Version Lifecycle (Simplified)
    dateFormat  YYYY-MM
    section Python 3.10
    Full Support    :done, p310, 2021-10, 2023-04
    Security Only   :active, p310s, 2023-04, 2026-10
    section Python 3.11
    Full Support    :done, p311, 2022-10, 2024-04
    Security Only   :active, p311s, 2024-04, 2027-10
    section Python 3.12
    Full Support    :active, p312, 2023-10, 2025-04
    Security Only   :p312s, 2025-04, 2028-10
    section Python 3.13
    Full Support    :active, p313, 2024-10, 2026-04
    Security Only   :p313s, 2026-04, 2029-10
Rule of Thumb
Use the second-latest stable Python version for production work. For example, if Python 3.13 is the latest, consider using Python 3.12 for better library compatibility.

Version Selection Decision Matrix

Your Use CaseRecommended Version
New personal projectLatest stable (3.12 or 3.13)
Production / EnterpriseSecond-latest (3.12)
Machine Learning / Data ScienceCheck library requirements
Legacy project maintenanceMatch existing environment
Following a tutorialMatch tutorial’s version

Checking Library Compatibility

Before committing to a Python version, verify your key dependencies support it:

1
2
3
# Example: Check PyPI for package compatibility
# Visit: https://pypi.org/project/<package-name>/
# Look for "Requires-Python" in the package metadata

Some popular libraries and their typical Python support:

  • NumPy: Usually supports latest stable within weeks
  • TensorFlow: Often lags 6-12 months behind latest Python
  • PyTorch: Generally good support, check official docs
  • pandas: Quick to adopt new versions
Machine Learning Projects
If using TensorFlow, PyTorch, or CUDA-dependent libraries, always check their official documentation for supported Python versions before installation.

Installing Python on Windows: The Right Way

Method 1: Official Installer (Simple but Limited)

The most straightforward approach is downloading from python.org :

  1. Download the installer for your desired version
  2. Important: Check “Add Python to PATH” during installation
  3. Important: Select “Disable path length limit” at the end
✅ Pros❌ Cons
Simple and officialHard to manage multiple versions
Works immediatelyUpgrading can be messy
Good for beginnersMay conflict with Microsoft Store
Avoid the Microsoft Store Version
The Microsoft Store Python is sandboxed and can cause permission issues with certain packages. Use the official python.org installer instead.

Method 2: WSL2 (For Backend Developers)

If you’re developing backend applications (Django, FastAPI) or need to deploy to Linux servers, Windows Subsystem for Linux 2 (WSL2) provides the most authentic development experience.

Installation

1
2
3
4
# Enable WSL2 (run as Administrator)
wsl --install

# After restart, Ubuntu will be installed by default

Workflow

  1. Install Python inside the Ubuntu environment (you can use uv there too!)
  2. Use VS Code with the WSL extension to edit files seamlessly
  3. Your code runs in a real Linux environment, matching production servers
✅ Pros❌ Cons
Matches Linux production environmentSlightly higher resource usage
Avoids Windows-specific compilation issuesLearning curve for Linux basics
Full access to Linux toolingFile system performance overhead
When to Choose WSL2
If you frequently encounter “this package doesn’t compile on Windows” errors, or you’re deploying to Linux servers, WSL2 solves these problems at the root.

uv is a blazingly fast Python package manager written in Rust. It’s becoming the de facto standard for modern Python development.

Why uv?

  • 10-100x faster than pip for package operations
  • Built-in Python version management (no need for separate pyenv)
  • Unified tooling for packages and environments
  • Cross-platform and actively maintained

Installation

1
2
# Install uv using PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Managing Python Versions with uv

1
2
3
4
5
6
7
8
# Install a Python version
uv python install 3.12

# List installed Python versions
uv python list

# Pin Python version for a project
uv python pin 3.12

Creating Projects and Managing Dependencies

1
2
3
4
5
6
7
8
9
# Create a new project (virtual environment created automatically)
uv init my-project
cd my-project

# Add dependencies (also installs them)
uv add numpy pandas matplotlib

# Run your code without manual activation
uv run python main.py
✅ Pros❌ Cons
Extremely fastRelatively new tool
Python version management built-inSome edge cases still maturing
Modern dependency resolutionLearning curve for new commands
Great error messages
Our Recommendation
For new Python projects in 2026, uv offers the best developer experience. Its speed and unified approach to Python and package management make it an excellent choice.

Here’s our recommended approach for setting up Python elegantly on Windows:

Step 1: Install uv

1
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Step 2: Install Your Preferred Python Version

1
2
3
4
5
6
# Install Python 3.12 (recommended for most projects)
uv python install 3.12

# Optionally install other versions for testing
uv python install 3.11
uv python install 3.13

Step 3: Create a New Project

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Initialize a new project
uv init my-awesome-project
cd my-awesome-project

# Pin Python version
uv python pin 3.12

# The virtual environment is created automatically
# Add your dependencies
uv add requests numpy pandas

Step 4: Working with the Environment

1
2
3
4
5
6
7
8
9
# Option A: Traditional activation
.venv\Scripts\activate
python your_script.py
deactivate

# Option B: Skip activation entirely (recommended!)
uv run python your_script.py
uv run pytest
uv run jupyter notebook
Pro Tip: Skip Activation with uv run
The uv run command automatically detects and uses your project’s virtual environment. You never need to remember .venv\Scripts\activate again — this is the most elegant workflow!

Project Structure

After setup, your project should look like:

1
2
3
4
5
6
my-awesome-project/
├── .venv/              # Virtual environment (auto-created)
├── .python-version     # Pinned Python version
├── pyproject.toml      # Project configuration
├── uv.lock             # Locked dependencies
└── your_code.py

VS Code Integration

VS Code is the recommended editor for Python development. Here’s how to make it work seamlessly with uv.

Quick Setup (Per Project)

  1. Open your project folder in VS Code
  2. Press Ctrl + Shift + P to open Command Palette
  3. Type Python: Select Interpreter and press Enter
  4. Select the interpreter from .venv\Scripts\python.exe

Create a .vscode/settings.json file in your project root:

1
2
3
4
5
{
  "python.defaultInterpreterPath": "./.venv/Scripts/python.exe",
  "python.analysis.typeCheckingMode": "basic",
  "python.analysis.autoImportCompletions": true
}

Troubleshooting: Import Errors After Installing Packages

If VS Code shows “Import could not be resolved” after running uv add:

  1. Press Ctrl + Shift + P
  2. Type Developer: Reload Window
  3. Press Enter — the errors should disappear

Recommended VS Code Extensions

  • Python (Microsoft) — Core language support
  • Pylance — Fast IntelliSense and type checking
  • Ruff — Lightning-fast linting and formatting

Migrating Existing Projects

If you have an existing project with a requirements.txt, migrating to uv is straightforward:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Navigate to your project
cd my-existing-project

# Create a virtual environment
uv venv

# Install from requirements.txt (blazingly fast!)
uv pip install -r requirements.txt

# Optional: Convert to modern pyproject.toml
uv init --existing

After migration, you can gradually modernize by using uv add for new dependencies.

Summary

ApproachBest ForComplexity
Official InstallerBeginners, single version
WSL2Backend development, Linux deployment⭐⭐
uv (Recommended)Modern workflow, speed, all-in-one⭐⭐

Key Takeaways:

  1. Version: Choose Python 3.12 for most projects — it’s stable and widely supported
  2. Tool: Use uv for a fast, modern, and unified experience
  3. Isolation: Always use virtual environments — never install packages globally
  4. Avoid: Microsoft Store Python — use the official installer or uv instead

With this setup, you’ll have a professional, reproducible Python environment that serves you well for years to come.

References