New: Complete Beginner's Guide to Coding is now available in Premium
Updated: Indian Govt Exam roadmaps now include salary breakdowns & timelines
Tip: Use the Career Hub to explore all career paths in one place

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)

  1. Go to python.org/downloads
  2. Click the big yellow "Download Python 3.12.x" button
  3. Run the downloaded .exe file
  4. ⚠️ CRITICAL: Check ✅ "Add python.exe to PATH" at the bottom
  5. Click "Install Now" (not Customize)
  6. Wait for installation to complete → click "Close"
  7. Verify: Open Command Prompt (Win+R → cmd) → type:
    python --version
    Should show: Python 3.12.x
  8. Test: Type python → then print("Hello World!") → press Enter

Install Python on Mac

  1. Mac comes with Python 2 pre-installed — you need Python 3
  2. Best method: Install Homebrew first:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Then install Python:
    brew install python
  4. 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)

  1. Download VS Code from code.visualstudio.com
  2. Install and open VS Code
  3. Go to Extensions (Ctrl+Shift+X) → search "Python" → install the Microsoft Python extension
  4. Create a new file: hello.py
  5. Type: print("Hello from VS Code!")
  6. 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

ErrorFix
'python' is not recognizedReinstall with "Add to PATH" checked, or add manually to System Environment Variables
pip not foundUse python -m pip install instead, or reinstall Python
Permission deniedRun as Administrator (Windows) or use sudo (Linux/Mac)
Multiple Python versionsUse python3 and pip3 explicitly on Mac/Linux

Next Steps

Start Python Tutorial Python Notes Python Basics Guide Complete Guide

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