Python Installation (Windows, Mac, Linux) – Step-by-Step Guide
Learning to program with Python? Before you begin writing code, you need to complete your Python installation. This guide covers the exact steps to install Python on Windows, macOS, and Linux. Whether you’re a complete beginner or setting up your first development environment, we’ll make the process clear and easy.
Why Install Python?
Python is a versatile programming language used for automation, data analysis, artificial intelligence, machine learning, and web development. It’s known for its readable syntax, which makes it great for beginners. Python is free, open-source, and runs on all major operating systems. After installing Python, you can run scripts, automate tasks, build applications, and explore hundreds of useful libraries.
Python Installation on Windows
Follow these steps to install Python on your Windows computer:
- Visit python.org.
- Click on the “Download Python” button for the latest version.
- Double-click the downloaded .exe file to launch the installer.
- Important: Check the box that says “Add Python to PATH”. This step is crucial for running Python from the command line.
- Click “Install Now” and let the installation finish.
- After installation, open Command Prompt and type:
python --version
If Python is installed correctly, you will see a version number such as Python 3.12.1
.
Python Installation on macOS
macOS includes Python by default, but it’s often outdated. To install the latest version:
- Go to python.org.
- Download the macOS installer package (.pkg file).
- Double-click to open the installer and follow the on-screen instructions.
- After installation, open the Terminal and run:
python3 --version
macOS uses python3
by default, so remember to use that instead of just python
.
Python Installation on Linux
On most Linux systems, Python comes pre-installed. However, if needed, here’s how to install or update Python on Ubuntu/Debian:
- Open your Terminal.
- Update the package manager:
sudo apt update
- Install Python:
sudo apt install python3
- Check the version:
python3 --version
Installing pip (Python Package Manager)
pip allows you to install external Python libraries and packages. It usually comes with Python, but if it doesn’t, run the following command:
python -m ensurepip --upgrade
To verify pip is working, type:
pip --version
Running Your First Python Script
Now that you’ve completed your Python installation, test it with a simple script. Create a file named hello.py
and add this code:
print("Hello, Python!")
Save the file. Then open your terminal or command prompt and run:
python hello.py
(orpython3 hello.py
on macOS/Linux)
Next Steps After Installing Python
Now that your Python installation is complete, it’s time to decide what to build. If you’re unsure where to begin, here are a few beginner-friendly projects you can try:
- Build a calculator app with basic math operations
- Automate file organization or folder creation
- Scrape websites using libraries like
BeautifulSoup
- Explore Python game development with Pygame
Want a project idea with step-by-step code? Read our next article: How to Create a To-Do List App in Python.
If you’re interested in data analysis, don’t miss our beginner guide to installing Pandas, NumPy, and Matplotlib. These are essential tools for working with data in Python.
You can also find dozens of Python beginner tutorials on websites like:
Helpful Resources
Final Thoughts
Installing Python is the first step toward becoming a programmer, data analyst, or automation expert. With this guide, you now know how to install Python on Windows, macOS, and Linux. Whether you’re running your first script or exploring powerful libraries, Python is the perfect language to begin your coding journey. Don’t stop here — explore, experiment, and start building.