FastAPI - Beginner to Pro / Python Installation & Refresher

Python Installation on Mac

There are two recommended ways to install Python on macOS:

  1. ✅ Using the official installer (best for beginners)

  2. ✅ Using Homebrew (best for developers)


✅ Method 1: Install Python from Official Website (Beginner Friendly)

Step 1: Check If Python Is Already Installed

Open Terminal (Press Command + Space → type Terminal → press Enter)

Run:

python3 --version

If you see something like:

Python 3.x.x

Python is already installed.

If not, continue below.


Step 2: Download Python

Go to the official website:

👉 https://www.python.org/downloads/mac-osx/

Download the latest stable version for macOS.

You’ll get a .pkg file.


Step 3: Install Python

  1. Double-click the downloaded .pkg file

  2. Click Continue

  3. Click Install

  4. Enter your Mac password

  5. Wait for installation to finish

That’s it.


Step 4: Verify Installation

Open Terminal again and run:

python3 --version

You should now see the installed version.


Step 5: Check pip (Python Package Manager)

pip3 --version

If pip is installed, you're ready to install libraries like:

pip3 install fastapi

🚀 Method 2: Install Python Using Homebrew (Recommended for Developers)

If you're a developer (especially backend or full stack), this is cleaner and more powerful.


Step 1: Install Homebrew (If Not Installed)

In Terminal, run:

/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"

After installation, run:

brew --version

Step 2: Install Python Using Brew

brew install python

Step 3: Verify Installation

python3 --version

⚠️ Important Notes for Mac Users

  • macOS already has a system Python — do not modify or remove it

  • Always use python3 instead of python

  • Always use pip3 instead of pip