Installing Python & Setting Up Your Environment
Before writing Python programs, you need Python installed on your system. In this lesson, you will learn how to install Python, verify the installation, and set up the tools required for smooth programming.
Step 1: Download Python
Python is available for Windows, macOS, and Linux. Always download it from the official website:
When downloading on Windows, make sure you choose the latest stable version (Python 3.x.x).
Step 2: Install Python (Windows Users)
Important: During installation, make sure you check the box:
Add Python 3.x to PATH
This step is extremely important because it allows you to run Python from any folder using the Command Prompt.
After checking that box, click Install Now. Wait until the installation completes.
Step 3: Verify Installation
Open your Command Prompt (Windows) or Terminal (Mac/Linux) and type:
python --version
If installed correctly, you will see something like:
Python 3.12.1
If you see a version number, Python is ready to use!
Step 4: Install a Code Editor
You can write Python in any text editor, but a good editor makes your life much easier. The best option is:
- Visual Studio Code (VS Code)
Download the editor from:
After installing VS Code:
- Open VS Code
- Go to Extensions
- Search for Python
- Install “Python Extension for VS Code”
Step 5: Run Your First Program
Create a new file in VS Code called test.py and write:
print("Python is installed successfully!")
Now run it:
python test.py
If you see the message printed, your setup is perfect.
Common Installation Issues
- “Python is not recognized” → PATH not added.
- VS Code not detecting Python → Install Python extension.
- Multiple versions installed → Use
python3on Mac/Linux.
You're Now Ready for Lesson 3!
You have Python installed, VS Code ready, and you can run Python files. From the next lesson onward, you’ll start learning real programming.
📝 Exercise
Try the following tasks:
- Open your terminal and check your Python version.
- Create a new file called hello.py and print your name.
- In VS Code, install the Python extension and run your script.
✅ Exercise Answers
1. Check Python version:python --version
print("Hello, my name is Sreekanth!")
python hello.py