How to Install Python — Step by Step Guide
Complete installation guide for Python 3.12+ on Windows, Mac, and Linux. Includes setting up PATH, choosing an IDE (VS Code recommended), creating virtual environments, and verifying your installation works correctly.
🖥️ Windows + Mac + Linux
⚡ 10 Minutes Setup
🛠️ IDE + Tools
Installing Python takes 5-10 minutes. The most common mistake is forgetting to check "Add to PATH" — this guide ensures you avoid all pitfalls. After installation, you'll also set up VS Code (the best free IDE) and create your first Python program.
Install Python on Windows (Step by Step)
- Go to python.org/downloads
- Click the big yellow "Download Python 3.12.x" button
- Run the downloaded
.exefile - ⚠️ CRITICAL: Check ✅ "Add python.exe to PATH" at the bottom
- Click "Install Now" (not Customize)
- Wait for installation to complete → click "Close"
- Verify: Open Command Prompt (Win+R → cmd) → type:
python --version
Should show:Python 3.12.x - Test: Type
python→ thenprint("Hello World!")→ press Enter
Install Python on Mac
- Mac comes with Python 2 pre-installed — you need Python 3
- Best method: Install Homebrew first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Then install Python:
brew install python - Verify:
python3 --version
Alternative: Download from python.org → run the .pkg installer.
Install Python on Linux
# Ubuntu/Debian
sudo apt update
sudo apt install python3 python3-pip python3-venv
# Fedora
sudo dnf install python3 python3-pip
# Verify
python3 --version
pip3 --version
Most Linux distros come with Python 3 pre-installed. Just verify the version.
Set Up VS Code (Recommended IDE)
- Download VS Code from code.visualstudio.com
- Install and open VS Code
- Go to Extensions (Ctrl+Shift+X) → search "Python" → install the Microsoft Python extension
- Create a new file:
hello.py - Type:
print("Hello from VS Code!") - Press Ctrl+F5 to run → output appears in terminal
Other IDEs: PyCharm (heavy but powerful), Jupyter Notebook (for data science), IDLE (comes with Python, basic).
Virtual Environments (Best Practice)
# Create virtual environment
python -m venv myproject_env
# Activate (Windows)
myproject_env\Scripts\activate
# Activate (Mac/Linux)
source myproject_env/bin/activate
# Install packages inside venv
pip install requests flask pandas
# Deactivate when done
deactivate
Why? Virtual environments keep each project's packages separate — no conflicts between projects.
Common Errors & Fixes
| Error | Fix |
|---|---|
'python' is not recognized | Reinstall with "Add to PATH" checked, or add manually to System Environment Variables |
pip not found | Use python -m pip install instead, or reinstall Python |
Permission denied | Run as Administrator (Windows) or use sudo (Linux/Mac) |
Multiple Python versions | Use python3 and pip3 explicitly on Mac/Linux |
Next Steps
People Also Search For
how to install python
python download windows 10
python PATH setup
python IDE for beginners
VS Code python setup
python virtual environment