Developer

How to Set Up Python on Windows 11 in 2026: A Beginner-Friendly Guide (uv + VS Code)

Never installed Python before? This step-by-step guide gets Python running on Windows 11 in about 20 minutes, using uv and VS Code. Plain English, copy-paste commands, and fixes for the problems beginners actually hit.

If you've ever tried to install Python on Windows and ended up with three different versions, a Microsoft Store page you didn't ask for, and an error message that made no sense, you're not alone. I've helped enough friends, cousins and college juniors through this to know where everyone gets stuck.

The good news is that in 2026 it's much easier than it used to be. This guide gets you from nothing to running your first Python program in about 20 minutes. You don't need any coding experience. Most of it is copying a command from this page, pasting it, and pressing Enter.


What You're Installing (in Plain English)

Before we start, here's what each piece is and why you need it. Good news first: everything in this guide is completely free, with no trials and no "pro version" upsell.

Python is the programming language itself, the thing that actually runs your code. It's free and open source, run by the non-profit Python Software Foundation, and it's the most popular first language for a reason: the code reads almost like plain English. The newest release is Python 3.15, but as you'll see below, we'll start with the slightly older 3.14.

uv is a small, free helper app made by a company called Astral. It does two jobs really well. First, it installs Python for you, so you skip the confusing official installer. Second, it keeps each of your projects in its own tidy box, so installing something for one project never breaks another. It's the reason this guide is short. The official uv documentation is well written if you ever want to dig deeper.

VS Code (Visual Studio Code) is Microsoft's free code editor, and it's what most programmers I know use every day. Think of it as Microsoft Word, but made for code. Its two big strengths for beginners are that it colours your code so it's easier to read, and it points out mistakes as you type, before you even run anything. On top of that, the free Python extension teaches it to understand Python properly.

Git is a free tool that saves versions of your work, like "track changes" for code, so you can always go back if you break something. You won't use it much today, but almost every coding tutorial assumes you have it, so we'll install it while we're at it.


Before You Start: Meet the Terminal

A few steps use the Terminal. It's a plain window where you type commands instead of clicking buttons. It looks a bit old-school, but don't let it put you off. You'll only be pasting in commands from this page.

To open it: right-click the Start button (the Windows logo on your taskbar) and choose Terminal.

To run a command from this guide:

  1. Copy the command from the grey box on this page.
  2. Click inside the Terminal window and press Ctrl + V to paste it (right-clicking also pastes).
  3. Press Enter.

One habit that will save you a lot of confusion: after you install something, close the Terminal and open a new one. A Terminal window that was already open doesn't "see" newly installed apps until you restart it.


Step 1: Install VS Code and Git

Windows 11 has a built-in app installer called winget that you use from the Terminal. It's Microsoft's own tool, it's free, and it downloads and installs apps straight from their official sources, so there's no hunting around websites for the right download button. (If you'd rather click through a normal installer, you can also download VS Code and Git from their websites. The end result is the same.)

Open the Terminal and run these two commands, one at a time:

winget install --id Microsoft.VisualStudioCode -e
winget install --id Git.Git -e

The first time you use winget, it may ask you to agree to its terms. Type Y and press Enter. You'll then see a progress bar, and at the end a message saying it successfully installed. If Windows pops up asking "Do you want to allow this app to make changes?", click Yes.

Now close the Terminal and open a new one.


Step 2: Install uv

Same idea, one more command:

winget install --id astral-sh.uv -e

Close the Terminal again, open a new one, and check that it worked:

uv --version

You should see something like uv 0.12.3. The exact number doesn't matter. If you see a version number, you're good.


Step 3: Install Python

Here's where uv saves you a lot of hassle. You don't need to download Python from a website or tick the "Add to PATH" box that everyone forgets. Just run:

uv python install 3.14

It takes a few seconds and finishes with a message that Python was installed.

Why 3.14 and not the newest version? Python 3.15 came out on 9 October 2026, so it's brand new. When a new version comes out, it takes a few months for all the popular add-ons to catch up with it. Python 3.14 is the safe choice: everything works on it today. You can switch later with one command.


Step 4: Create Your First Project

A "project" is just a folder that holds your code. Let's make one inside your Documents folder. Run these commands one at a time:

mkdir ~\Documents\python-projects
cd ~\Documents\python-projects
uv init --no-package hello-python
cd hello-python

Here's what each line does:

  • mkdir makes a new folder called python-projects inside Documents. (It stands for "make directory", and a directory is just a folder.)
  • cd means "change directory", which is how you move into a folder in the Terminal.
  • uv init --no-package hello-python creates your first project, called hello-python, with a starter file named main.py already inside.
  • The last cd moves you into that new project folder.

What's the --no-package bit? It tells uv to make a simple, beginner-style project. Since uv 0.12 (July 2026), uv otherwise creates a more complicated layout that's meant for people publishing their code for others to install. You don't need that.

Now tell this project which Python to use, and run it:

uv python pin 3.14
uv run main.py

You should see:

Hello from hello-python!

That's your first Python program running. The first time you run it, uv quietly sets up a private space for this project (a hidden .venv folder). That's why it took a second longer. After that, it's instant.


Step 5: Open Your Project in VS Code

While you're still in the project folder in the Terminal, run:

code .

The dot means "this folder", so VS Code opens with your project loaded.

A few things will probably pop up the first time. Here's what to click:

  1. "Do you trust the authors of the files in this folder?" Click Yes, I trust the authors. It's your own folder.
  2. Install the Python extension. Click the Extensions icon in the left sidebar (it looks like four small squares), search for Python, and install the one published by Microsoft. It's usually the first result, and it's the same free Python extension linked earlier. This teaches VS Code to understand Python.
  3. If VS Code asks you to select a Python interpreter, pick the one that mentions .venv. That's the private space uv made for this project.

Now open main.py from the file list on the left. Change the text inside the quotes to anything you like, for example:

def main():
    print("My first Python program. Hello, world!")


if __name__ == "__main__":
    main()

Save with Ctrl + S. VS Code has its own Terminal built in. Open it from the top menu with View → Terminal, then run:

uv run main.py

You should see your new message. You're officially writing Python.


Step 6: Adding Extra Tools to Your Project

Sooner or later, a tutorial will tell you to install something like requests or pandas. These are packages: ready-made add-ons other people wrote so you don't have to start from scratch. With uv, adding one is a single command, run from inside your project folder:

uv add requests

uv downloads it and writes it down in your project's settings, so next time you (or a friend) open this project, the same add-ons get installed automatically.

One tip that will save you confusion: a lot of older tutorials say to type pip install something. In a uv project, use uv add something instead. It does the same job, just in a tidier way.


Optional: Tell Git Who You Are

If you plan to put your code on GitHub later, Git needs your name and email. GitHub is the website where most people store and share code. It's free for personal use, including private projects, and only teams with advanced needs pay. Replace the example details with your own:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

You only ever do this once per computer.


Common Problems and How to Fix Them

"uv is not recognized" or "code is not recognized" The Terminal was opened before the app was installed. Close every Terminal window and open a fresh one. If it still doesn't work, sign out of Windows and sign back in.

"winget is not recognized" winget comes with a Windows app called App Installer. Open the Microsoft Store, search for App Installer, and update it. Then try again in a new Terminal.

Typing python opens the Microsoft Store instead of running Python This one confuses almost everyone. Windows 11 ships with a built-in shortcut: when you type python, Windows assumes you don't have it yet and sends you to the Store to download it. Windows calls these shortcuts "App execution aliases", a name that would confuse anyone.

You don't actually need to type python on its own in this guide, because uv run takes care of it. But if another tutorial asks you to, here's how to switch the shortcut off:

  1. Press Windows key + I to open Settings.
  2. Go to Apps → Advanced app settings → App execution aliases.
  3. Scroll down to the two entries called App Installer that mention python.exe and python3.exe, and switch both off.

Some people find these switches turn themselves back on after a while. That's harmless for anything in this guide. Just keep using uv run.

VS Code underlines your code in red, even though it runs fine VS Code is looking at the wrong Python. Press Ctrl + Shift + P, type Python: Select Interpreter, and choose the one with .venv in its name.

An add-on fails to install with a long error about "building" or a "compiler" That usually means the add-on doesn't support your Python version yet. Make sure your project uses 3.14 (uv python pin 3.14), then run uv sync to set things up again.


The Short Version

Once everything's installed, starting any new project is just this:

cd ~\Documents\python-projects
uv init --no-package my-new-project
cd my-new-project
code .

Four lines, and you're writing code. No installer wizards, no PATH checkboxes, and no wondering which of three Pythons you're actually using.

When you're ready for the next step, like saving your projects to GitHub or setting up tools that tidy your code automatically, I'll cover that in a separate guide so this one stays beginner-friendly.