Skip to content

Environment Setup - Mac

This guide provides step-by-step instructions on how to install Python 3.10 and Docker on your Mac using Homebrew, a popular package manager for macOS.

Prerequisites

  • macOS operating system
  • Administrator access to your Mac
  • An internet connection

Step 1: Install Homebrew

Homebrew is a free and open-source package management system that simplifies the installation of software on macOS. If you do not have Homebrew installed on your Mac, follow these steps to install it.

Open the Terminal app. You can find it in the /Applications/Utilities folder or search for it using Spotlight.

Copy and paste the following command into Terminal and press Enter:

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

The script explains what it will do and then pauses before it does it. You may be prompted to enter your password to allow the installation to proceed.

Follow the on-screen instructions to complete the installation of Homebrew.

Once installed, you'll need to add Homebrew to your PATH if the installation script hasn't already done it for you. Add the following line to your .zshrc or .bash_profile file:

sh
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$(whoami)/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Verify the installation by running:

sh
brew --version

Step 2: Install Python 3.10

Now that Homebrew is installed, you can easily install Python 3.10.

Update Homebrew's package database:

sh
brew update
Install Python 3.10 by running:

```sh
brew install python@3.10

After installation, link Python 3.10 if it's not already set as the default version:

sh
brew link python@3.10

Confirm that Python 3.10 is installed correctly:

sh
python3 --version

You should see Python 3.10.x as the output.

Step 3: Install Docker

Docker allows you to package an application with all of its dependencies into a standardized unit for software development.

Update Homebrew's package database (if you haven't already):

sh
brew update

Install Docker using Homebrew by running:

sh
brew install --cask docker

Once installed, you can open Docker from the Applications folder or search for it using Spotlight.

Follow the on-screen instructions to complete the Docker setup.

Step 4: Verify Docker Installation

To verify that Docker has been installed correctly and is running, open Terminal and type:

sh
docker --version

You should see the Docker version displayed, confirming the successful installation.