Skip to content
QUEST & CROSSFIRE

Blog  / AI Engineering

Stop Installing Python: The Clean Windows Setup Reference (uv + Git)

By Asheesh Ranjan Srivastava · · 4 min read Includes video

Watch the video above if you want a click-by-click walkthrough on Windows. Bookmark this companion page next to your terminal as a copy-paste command cheat sheet, 6-file project map, and Windows troubleshooting guide for uv + Git.

Almost every Python tutorial starts by telling you to download a global Python installer and run pip install. That works for project one, and breaks the day project two needs a different package version.

A durable Python setup rests on three isolated pieces:

  1. A project folder: Everything for one project lives in one directory; delete the folder and the project is gone cleanly.
  2. A per-project virtual environment (.venv): Think of a family sharing one pair of glasses: grandma needs +2.5 and a younger sibling needs -1.5. One global Python install cannot serve conflicting projects; each project gets its own pair of glasses.
  3. Git save points: Versioned checkpoints so you can inspect mistakes (git diff) and roll back (git restore) in seconds.

uv builds the folder, fetches Python automatically, creates .venv, and initializes Git in one workflow, without ever touching a global Python installer or manually activating environments on Windows.

One-Screen Windows Command Reference

1. Check before installing

Always check first so you don’t end up with duplicate copies of tools:

uv --version
git --version

2. Install Git and uv (only if missing)

Run in Windows PowerShell:

winget install Git.Git
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Tip: If PowerShell still says uv or git is not recognized right after installing, close and open a new terminal (or restart your editor).

3. Initialize a project, add a dev tool, and verify

uv init learn-python
cd learn-python
uv add --dev pytest
uv run python --version
uv run learn-python

Notice what is missing: no python.org installer, no “Add Python to PATH” checkbox, and no manual git init (uv init already initialized Git for you).

4. Create your first Git save point and roll back mistakes

git status
git add .
git commit -m "Initial commit"

When a code edit breaks something later, inspect and revert cleanly:

git status
git diff
git restore src/learn_python/__init__.py

The 6-File Project Anatomy: What Each File Does

Every file uv init creates has one specific job; nothing is magic:

File / FolderRole in Plain EnglishEdit by Hand?Tracked by Git?
src/learn_python/__init__.pyYour actual source code (__init__.py marks the folder as a Python package; underscores replace hyphens because Python reads - as minus)YesYes
pyproject.tomlThe project’s ID card: name, accepted requires-python range, runtime dependencies, [dependency-groups] dev tools (like pytest), and [project.scripts] commandsYes (or via uv add)Yes
.python-versionPins the exact Python version uv selected for this projectRarelyYes
uv.lockExact version snapshot of every package and sub-dependencyNever (uv manages it)Yes
.venv/The installed environment (“the glasses”), plus pyvenv.cfg pointing to uv‘s central Python copyNeverNo (ignored in .gitignore)
.gitignore & README.mdTells Git to skip .venv/ (“keep the prescription, not the glasses”) + project front page for GitHubYesYes

Three Windows Friction Points uv Eliminates

  1. No .venv\Scripts\activate PowerShell errors: Traditional tutorials require activating the virtual environment in every new terminal, often triggering Windows PowerShell execution-policy red errors before you write a single line of Python. With uv run <command>, uv automatically syncs and runs inside the project’s .venv every time without activation.
  2. Disposable environments: Because uv keeps a single shared Python copy outside your project and records the exact environment in pyproject.toml + uv.lock, you can delete .venv/ completely and run uv run learn-python; uv rebuilds .venv in about a second.
  3. Clean edit-save-run loop: uv installs your src/ package in editable mode, so every time you edit src/learn_python/__init__.py and run uv run learn-python, it immediately runs your updated code without reinstalling.

Links & Resources

Scroll to Top