Python Installation and Setup (Windows, VS Code, IDLE)
In this lesson: Download and install Python, add to PATH, check version, use IDLE or VS Code and run hello.py — easy steps in Hindi & English.
Why install Python
To write and run Python programs on your own computer, you first install Python — the language and its interpreter that runs your code. It is free and works on Windows, Mac and Linux. Once installed, you can run programs, use libraries, and build real projects.
Downloading Python
- Go to the official website python.org and open the Downloads page.
- Download the latest stable version for your operating system.
- Run the installer you downloaded.
Always download from python.org, not from random sites, so you get a safe, official copy.
Add to PATH (important)
On Windows, the first installer screen has a checkbox at the bottom: "Add Python to PATH". Tick it before clicking Install.
python from any folder.Check the version
After installing, open the command line (Command Prompt on Windows, Terminal on Mac/Linux) and type:
python --version
If you see a version number, Python is installed correctly. On Mac/Linux you may need python3 --version instead.
Run your first program
Create a file called hello.py with this line:
print("Hello, Python!")
Open the command line in that folder and run:
python hello.py
That is it — you have written and run your first Python program. print() shows text on the screen.
Choosing an editor
- IDLE — comes with Python, simple, great for your first days.
- VS Code — free, powerful, with a Python extension; best for real projects.
- Thonny — beginner-friendly, shows variables as you go.
Start with IDLE or Thonny if you are new, then move to VS Code as your projects grow.
Common mistakes
- Forgetting "Add to PATH". Then
pythonis not recognised in the terminal. - Downloading from the wrong site. Always use python.org.
- Using
pythonvspython3. On Mac/Linux the command is oftenpython3. - Saving without a
.pyextension. The file must end in.pyto run as Python.
Summary
- Install Python from the official python.org site.
- On Windows, tick "Add Python to PATH" during install.
- Check it with
python --version. - Run a program with
python filename.py. - Start with IDLE or Thonny, then use VS Code for bigger projects.
Next, learn the basics in Python variables, or write decisions with if-else in Python.
Frequently Asked Questions
How do I install Python on my computer?
Why must I tick "Add Python to PATH"?
python from any folder in the command line. If you forget it, the terminal will say "python is not recognised", and you would have to reinstall or fix the PATH manually.How do I check if Python is installed?
python --version (or python3 --version on Mac/Linux). If it shows a version number like Python 3.12, Python is installed correctly.What is the difference between IDLE and VS Code?
How do I run a Python file?
.py, open the command line in that folder, and type python filename.py. The program runs and shows its output right there.