Whether you're diving into data science, web development, or automation, Python is one of the best programming languages to start with. In this guide, I’ll walk you through how to install Python on both Windows and macOS, step-by-step.
Python is:
Easy to learn and read
Widely used in machine learning, data analysis, and automation
Supported by a massive community and countless libraries
Let’s get started!
Go to the official Python website: https://www.python.org/downloads
Click the Download Python button (the latest version will be highlighted).
Open the downloaded .exe file.
Important: Check the box that says “Add Python to PATH”.
Click Install Now.
Open Command Prompt.
Type:
python --version
You should see something like Python 3.12.0.
Click the Download Python button for macOS.
Open the downloaded .pkg file.
Follow the installation steps.
Open Terminal.
Type:
python --version
You should see the installed version, e.g., Python 3.12.0.
To write and run Python code easily, install a code editor like:
PyCharm
Thonny – great for beginners
Create a simple Python file to test:
Open your text editor.
Write:
print("Hello, Python!")
Save it as hello.py.
Run it from Terminal from the folder in which hello.py is saved:
python hello.py # Windows
python3 hello.py # macOS
You're Ready to Code!
Now that Python is installed, you’re all set to start learning and building. Whether you're exploring data science or automating tasks, Python opens up a world of possibilities.