Lesson 2: Installing Python
Set up your coding environment and write your first real program!
Beginner Level | 12 min readBefore We Begin
Installing Python is completely free and takes just a few minutes. By the end of this lesson, you'll have Python running on your computer!
What you'll need:
- A computer (Windows, Mac, or Linux)
- Internet connection
- About 100MB of free space
- 5-10 minutes of your time
Step 1: Download Python
Go to python.org and click on "Downloads"
The website automatically detects your operating system and suggests the right version.
Download Python 3.11 or later (NOT Python 2.x - it's outdated)
Recommended: Always get the latest stable version
Step 2: Install Python
For Windows Users
- Run the downloaded installer file
- IMPORTANT: Check the box "Add Python to PATH"
- Click "Install Now"
- Wait for installation to complete (2-3 minutes)
- Click "Close" when finished
For Mac Users
- Open the downloaded .pkg file
- Follow the installation wizard
- Click "Continue" through the steps
- Enter your password when prompted
- Click "Install" and wait
- Installation complete!
For Linux Users
Most Linux distributions come with Python pre-installed. Open terminal and type:
python3 --version
If not installed, use your package manager:
sudo apt-get install python3
Step 3: Verify Installation
Windows: Open Command Prompt (search "cmd")
Mac/Linux: Open Terminal
Type this command:
python --version
You should see something like: Python 3.11.0
Step 4: Run Your First Program
Now let's write code! Open your terminal/command prompt and type:
python
You'll see the Python prompt (>>>). Now type:
>>> print("I just installed Python!")Output:
I just installed Python!
Interactive Quiz Time!
Common Issues & Solutions
Problem: "python is not recognized"
Solution: You forgot to add Python to PATH. Reinstall and check that box!
Problem: Command prompt won't open
Solution: Search for "cmd" or "terminal" in your start menu
Key Takeaways
- Download Python from python.org
- Install Python 3.11 or later
- Add Python to PATH (Windows)
- Verify with python --version
- Use python command to start coding
0 Comments