Lesson 2: Installing Python 3.14+ on Your Computer
Without a working Python installation, nothing else in this chapter happens. So let's get this right.
This lesson is platform-specific. Scroll to your operating system (Windows, Mac, or Linux) and follow those instructions. If something goes wrong, we'll show you how to troubleshoot with your AI companion.
Why Installation Matters
You need Python installed on your computer to run Python programs. Just like you need Word installed to open .docx files, you need Python installed to run .py files.
We're specifically using Python 3.14+ (the latest modern version). Why 3.14+ and not an older version? Because newer versions have features we use throughout Part 4. Older versions lack these features.
Installation is the bridge between "understanding Python" and "running Python code."
Choose Your Operating System
Pick the section below that matches your computer:
Windows Installation
Step 1: Download Python
Go to python.org/downloads in your web browser.
You'll see a large yellow button that says "Download Python 3.14.x" (or whatever the latest version is). Click it.
This downloads an installer file to your computer (usually to your Downloads folder).
Step 2: Run the Installer
Find the downloaded file (it'll be named something like python-3.14.x-amd64.exe) and double-click it.
An installer window opens. This is where Windows installations often go wrong, so pay attention to this:
CRITICAL: You'll see a checkbox that says "Add Python to PATH."
Check this box. This allows your terminal to find Python.
Click through the remaining screens and select "Install Now." The installer will add Python to your computer.
Step 3: Verify Installation
Open a terminal (Command Prompt or PowerShell). Type:
python --version
Press Enter. You should see output like:
Python 3.14.0
If it shows "Python 2.x" or a lower version, you need to reinstall. If it says "python: command not found," see "Troubleshooting" below.
Step 4: Test with a Simple Program
Still in your terminal, type this exact command:
python -c "print('Hello, Python!')"
Press Enter. You should see:
Hello, Python!
Congratulations—Python is installed and working on Windows.
Mac Installation
Step 1: Download Python
Go to python.org/downloads in your web browser.
Click the yellow "Download Python 3.14.x" button.
This downloads an installer file (usually to your Downloads folder).
Step 2: Run the Installer
Find the downloaded file and double-click it.
A macOS installer window opens. Follow the prompts. Unlike Windows, you don't need to worry about PATH—macOS usually handles this automatically.
Step 3: Verify Installation
Open Terminal (Applications → Utilities → Terminal). Type:
python3 --version
Press Enter. You should see:
Python 3.14.0
Note: On Mac, you might need to use python3 instead of python if Python 2 is also installed. Both work—they're the same thing on modern Macs.
Step 4: Test with a Simple Program
In your terminal, type:
python3 -c "print('Hello, Python!')"
Press Enter. You should see:
Hello, Python!
Python is now installed and working on Mac.
Linux Installation
Step 1: Use Your Package Manager
Linux doesn't require downloading from python.org. Your package manager can install Python.
Ubuntu/Debian:
sudo apt update
sudo apt install python3.14
Fedora/Red Hat:
sudo dnf install python3.14
macOS (using Homebrew, if you prefer):
brew install [email protected]
Step 2: Verify Installation
Open a terminal. Type:
python3 --version
Press Enter. You should see:
Python 3.14.0
Step 3: Test with a Simple Program
python3 -c "print('Hello, Python!')"
Press Enter. You should see:
Hello, Python!
Python is installed on Linux.
Troubleshooting with AI Assistance
Did something go wrong? Don't panic. This is where AI excels.
Tip
Different computers have different setups. If your installation differs from the steps above, that's normal. Your AI tool (Claude Code or Gemini CLI) is perfect for platform-specific troubleshooting.
Copy the exact error message you got and ask your AI:
I tried to install Python on [Windows/Mac/Linux] and got this error:
[paste the full error message here]
What does this mean, and how do I fix it?
Provide context:
- Your operating system version
- Whether you checked "Add to PATH" (Windows)
- The exact error message
Your AI will give you step-by-step solutions specific to your setup.
🚀 CoLearning Challenge
Once you've verified Python works, experiment further:
Run this command:
python --version
or
python3 --version
What output did you get?
Now ask your AI: "Explain what the --version flag does in the python command and why we use it."
This teaches you that commands can have options (flags) that modify their behavior—a useful pattern throughout programming.
Common Mistakes
Mistake 1: "I installed Python 2 instead of Python 3.14"
Check your version: python --version should show "Python 3.14.x" or higher.
If it shows "Python 2.x", uninstall Python 2 and install Python 3.14 from python.org.
Mistake 2: "Python command not found" or "python: command not found"
This usually means Python isn't in your PATH (especially on Windows).
On Windows: Reinstall Python and check the "Add Python to PATH" checkbox.
On Mac/Linux: Try using python3 instead of python.
If still stuck, ask your AI companion: "I get 'python: command not found' when I run python --version. How do I fix this?" Include your operating system.
Mistake 3: "I don't know if my installation is correct"
Run both these commands:
python --version
python -c "print('Hello')"
If both work and show correct output, your installation is correct. Done.
Try With AI
Use your AI companion (Claude Code or Gemini CLI) for these prompts.
Prompt 1: Recall – Where and Why
Where did you download Python from? Why does the lesson specify python.org (not some random website)?
Expected Outcome: You recall the official source. You understand why downloading from the official website matters (authenticity, security).
Prompt 2: Understand – Version Requirements
The lesson says "Python 3.14+ is required." Explain:
1. Why do we need a specific version (why not any Python 3.x)?
2. What does "3.14+" mean? (What's the "+" symbol mean?)
3. How did you check your version?
Expected Outcome: You understand semantic versioning (3.14 means major.minor). You see "3.14+" as "version 3.14 or higher". You can explain why version matters.
Prompt 3: Apply – Troubleshoot an Error
Imagine a friend says: "I installed Python but when I run `python --version` I get an error: 'python: command not found'."
What would you tell them to do? You're the expert now!
Explain the likely cause and solution.
Expected Outcome: You apply your troubleshooting knowledge to a real problem. You practice explaining technical solutions—a valuable skill.
Prompt 4: Analyze – Verification Strategies
We verified Python installation with TWO commands:
1. `python --version`
2. `python -c "print('Hello')"`
Why use two commands instead of just one?
What does each command tell us?
Ask your AI: "What's the difference between `python --version` and running a test print statement?"
Think about: What information does each provide? Why do both matter?
Expected Outcome: You understand that version checking and functionality testing are different. You learn about verification strategies—a professional skill for validating that software works.