Python is one of the most popular programming languages in the world.
It is used for:
- Web development
- Automation
- Data analysis
- Machine learning
- Artificial intelligence
- Scripting and system tools
If you're starting your programming journey, installing Python is your first step.
This guide will walk you step-by-step through installing Python on:
- Windows
- macOS
- Linux
No prior experience required.
1. How to Install Python on Windows
Step 1: Download Python
- Go to the official website: https://www.python.org/downloads/
- Click Download Python (the latest version will be suggested automatically).
Note: Only download Python from the official website.
Step 2: Run the Installer
- Open the downloaded
.exefile. -
IMPORTANT: Check the box that says:
Add Python to PATH.This step is critical. If you skip it, Windows won’t recognize Python in the command line. -
Click Install Now.
- Wait until installation completes.
- Click Close.
Step 3: Verify Installation
- Open Command Prompt.
- Type:
python --version
or
py --version
You should see something like: Python 3.12.1. If you see the version number, Python is installed.
2. How to Install Python on macOS
macOS usually comes with an older version of Python, but we want the latest version.
Step 1: Download Python
- Visit: https://www.python.org/downloads/
- Click
Download for macOS. - Download the
.pkginstaller.
Step 2: Install Python
- Open the
.pkgfile. - Follow the installation wizard.
- Click
Continue -> Install. - Enter your Mac password if asked.
- Finish installation.
Step 3: Verify Installation
Open Terminal and type:
python3 --version
You should see something like: Python 3.12.1. On macOS, you usually use python3 instead of python.
3. How to Install Python on Linux
Most Linux distributions already include Python. But you may want to install or update to the latest version.
Step 1: Check If Python Is Installed
Open Terminal and type:
python3 --version
If you see a version number, Python is already installed.
Step 2: Install Python (If Needed)
Ubuntu / Debian
sudo apt update
sudo apt install python3
Fedora
sudo dnf install python3
Arch Linux
sudo pacman -S python
Step 3: Verify Installation
python3 --version
You should see the installed version.
4. Optional: Install pip (Python Package Manager)
pip is used to install Python libraries.
Check if pip is installed:
pip --version
or
pip3 --version
If not installed:
Windows
Re-run installer and choose Modify -> Ensure pip is selected.
Linux
sudo apt install python3-pip
macOS
python3 -m ensurepip --upgrade
5. Test Python (Your First Code)
Open Terminal or Command Prompt and type:
python
or
python3
Then type:
print("Hello, World!")
Press Enter. If you see "Hello, World!", you're officially running Python. Exit by typing:
exit()
6. Recommended Next Steps
Now that Python is installed, you can:
- Learn basic syntax
- Create virtual environments
- Install libraries like
requests,pandas, orDjango - Start building real projects
Programming is learned by building, not just reading.
Final Thoughts
Installing Python is simple once you know the steps.
The key points:
- Download from official website
- Add Python to PATH (Windows)
- Verify installation using terminal
- Use python3 on macOS and Linux
Welcome to the Python ecosystem.