Here’s a clear, step-by-step note on installing Python for Windows, Mac, and Linux:
Installing Python on Windows, Mac, and Linux
1. Installing Python on Windows
Download
- Go to python.org/downloads.
- Click Download Python (latest version) for Windows.
Run Installer
- Double-click the downloaded
.exefile. - Important: Check the box "Add Python to PATH" before clicking Install Now.
- Double-click the downloaded
Verify Installation
Open Command Prompt and run:
python --versionIf installed correctly, it shows the version (e.g.,
Python 3.12.0).
2. Installing Python on macOS
Check Existing Installation
macOS may come with an older Python version.
Open Terminal and run:
python3 --version
Install via Official Website
- Download the latest
.pkgfile from python.org/downloads. - Run the installer and follow on-screen steps.
- Download the latest
Alternative: Install via Homebrew
Install Homebrew (if not installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install Python:
brew install python
Verify Installation
python3 --version
3. Installing Python on Linux (Ubuntu/Debian)
Check Existing Python
python3 --versionUpdate Package List
sudo apt updateInstall Python
sudo apt install python3Install Pip (Package Manager)
sudo apt install python3-pipVerify Installation
python3 --version pip3 --version
4. Installing Python on Linux (Fedora/RHEL/CentOS)
sudo dnf install python3
python3 --version
5. Tips After Installation
Check pip:
pip --versionUpgrade pip:
python -m pip install --upgrade pipInstall Virtual Environment (optional but recommended):
python -m venv myenv