Setting up your Python development environment properly is the foundational step in your programming journey. In this detailed guide, you will learn how to download, install, and verify modern Python 3 on Windows 11/10, macOS, and Linux (Ubuntu/Debian), along with configuring the IDLE development environment.
Figure 3.1: Python official download page on python.org automatically detecting your operating system.
Follow these exact steps to ensure a flawless installation on your Windows PC:
• Step 1.1: Download Installer: Navigate to python.org/downloads and click the prominent yellow button labeled "Download Python 3.x.x".
• Step 1.2: Launch Installer: Double-click the downloaded executable file (e.g. python-3.12.x-amd64.exe).
• Step 1.3: THE CRITICAL STEP (Add to PATH): On the bottom of the installation window, you will see a checkbox: [x] Add python.exe to PATH. You MUST check this box! If left unchecked, your command prompt will show the error 'python' is not recognized as an internal or external command.
• Step 1.4: Install Now: Click "Install Now". Windows will request Administrator permission; click Yes. Once completed, click "Disable path length limit" if prompted, then click Close.
Figure 3.2: Crucial step: Ensure 'Add python.exe to PATH' is checked before clicking Install Now.
While macOS previously included an obsolete version of Python 2.7, modern Python development requires Python 3:
• Option A (Official PKG): Download the macOS 64-bit universal installer from python.org, open the .pkg file, and follow the standard installation wizard.
• Option B (Homebrew Terminal): If you use Homebrew package manager, open Terminal and simply run:
# Install Python 3 on macOS via Homebrew
brew update
brew install python
Almost all modern Linux distributions come with Python 3 pre-installed. You can update or install it via your native package manager:
# For Ubuntu / Debian / Linux Mint:
sudo apt update
sudo apt install python3 python3-pip python3-idle -y
# For Fedora / Red Hat / CentOS:
sudo dnf install python3 python3-pip
To confirm that Python and the pip package manager are correctly installed and accessible system-wide, open your Command Prompt (CMD), PowerShell, or Linux Terminal, and execute:
python --version
pip --version
Python 3.12.2
pip 24.0 from C:...site-packagespip (python 3.12)
Note for Mac and Linux users: If typing python outputs Python 2 or command not found, use python3 --version and pip3 --version.
When you install Python on Windows or Mac, it bundles an official lightweight IDE called IDLE. IDLE features syntax highlighting, smart code indentation, and an interactive shell. To launch it, search for "IDLE" in your Windows Start Menu or Mac Spotlight search.
Figure 3.3: Python IDLE interactive shell executing code in real time.
Open your terminal or IDLE shell and type the following commands:
>>> 25 * 4
100
>>> site = "Veewom.com"
>>> f"Learning Python on {site}"
'Learning Python on Veewom.com'
>>> exit()