Advertisement

How to Set Up Python on Windows: Complete Guide

Setting up Python on Windows is pretty straightforward, but there are a few things that trip people up. I've helped dozens of people install Python, and I'm going to walk you through it step by step so you don't run into the common problems.

By the end of this guide, you'll have Python installed, verified, and ready to use. Let's get started.

Step 1: Download Python

Go to python.org and click the big "Download Python" button. It'll download the latest version (3.x). Don't download Python 2 - it's outdated and not supported anymore.

The download is usually around 25-30 MB, so it shouldn't take long. Once it's downloaded, you'll have a file like python-3.12.0-amd64.exe.

Step 2: Run the Installer

Double-click the installer. You'll see a setup window. Here's the important part:

Check the box that says "Add Python to PATH"

This is crucial. If you don't check this, you'll have to add Python to PATH manually later, which is annoying. Just check it now.

Then click "Install Now". The installer will do its thing - this takes a few minutes.

You might see a User Account Control prompt asking for permission. Click "Yes" to allow it.

Step 3: Verify Installation

Once installation is done, let's make sure it worked. Open Command Prompt (press Windows key, type "cmd", press Enter).

Type this and press Enter:

python --version

You should see something like "Python 3.12.0" (the version number might be different). If you see this, Python is installed correctly!

If you get an error like "'python' is not recognized", Python isn't in your PATH. We'll fix that next.

Step 4: Fix PATH Issues (If Needed)

If Python didn't get added to PATH, here's how to fix it:

  1. Find where Python installed (usually C:\Users\YourName\AppData\Local\Programs\Python\Python3xx or C:\Python3xx)
  2. Copy that path
  3. Right-click "This PC" → Properties → Advanced system settings
  4. Click "Environment Variables"
  5. Under "System variables", find "Path" and click "Edit"
  6. Click "New" and paste the Python path
  7. Also add the Scripts folder (usually C:\Users\YourName\AppData\Local\Programs\Python\Python3xx\Scripts)
  8. Click OK on everything
  9. Close and reopen Command Prompt

Now try python --version again. It should work.

Step 5: Test Python

Let's make sure Python actually works. In Command Prompt, type:

python

You should see the Python prompt (>>>). Type:

print("Hello, Python!")

Press Enter. You should see "Hello, Python!" printed. Type exit() to leave Python.

If this works, you're all set!

Advertisement

Installing Packages with pip

Python comes with pip, a package manager that lets you install additional libraries. Let's test it:

pip --version

You should see pip's version. If you get an error, pip might not be installed. You can install it by running:

python -m ensurepip --upgrade

To install a package, use:

pip install package-name

For example, pip install requests installs the requests library.

Common Issues and Fixes

  • "python is not recognized": Python isn't in your PATH. Follow Step 4 to fix it.
  • "pip is not recognized": Try python -m pip instead of just pip.
  • Permission errors: Run Command Prompt as administrator (right-click, "Run as administrator").
  • Old Python version: Make sure you downloaded Python 3.x, not 2.x. Check python.org for the latest version.
  • Multiple Python versions: If you have multiple versions, use py -3 to run Python 3 specifically.

Recommended: Install a Code Editor

While you can write Python in Notepad, a proper code editor makes life much easier. I recommend:

  • VS Code: Free, popular, lots of extensions. Great for beginners and pros.
  • PyCharm: Made specifically for Python. Free community edition available.
  • Sublime Text: Lightweight and fast. Free to try, paid license.

VS Code is probably the best choice for beginners. It's free, works great, and has excellent Python support.

Next Steps

Now that Python is installed, you can:

  • Start learning Python basics
  • Write your first Python program
  • Install useful packages with pip
  • Set up a development environment

Check out our Python for Beginners course to get started coding!

Pro Tip: Keep Python updated. New versions come out regularly with bug fixes and improvements. You can check for updates at python.org, or use python -m pip install --upgrade pip to update pip.

Common Questions

Do I need to uninstall old Python versions?

Not necessarily. You can have multiple versions installed. But if you're not using an old version, uninstalling it keeps things cleaner. Use py -0 to see all installed versions.

Should I install Python from Microsoft Store?

You can, but I recommend downloading from python.org instead. The Microsoft Store version sometimes has issues with pip and packages. The official installer is more reliable.

What's the difference between Python and Anaconda?

Anaconda is Python plus a bunch of data science packages pre-installed. For beginners, regular Python is fine. Anaconda is useful if you're doing data science or machine learning, but it's overkill for learning basics.

You're Ready to Code

Python is installed and working. Now the fun part - start writing code! Open a text editor, write a simple program, and run it. The more you practice, the better you'll get. Check out our Python beginner's course to get started.

Advertisement