Installing Python, pip, and git on Mac

A step-by-step guide to setting up a development environment on macOS so you can start using ailia SDK.

Choose your OS: Windows · Mac · Linux

About this guide

To use ailia SDK from Python, you need three things: Python, pip, and git. Since macOS ships with Python 3, you can essentially start from setting up git. This guide explains how to check each of them and how to install anything that is missing.

Opening Terminal: The commands below are run in the "Terminal" app. Search for "Terminal" in Launchpad, or open Spotlight with command + space and type "Terminal".

1. Checking Python

macOS comes with Python 3, so first check whether it is available. Run the following command in Terminal.

python3 --version

If the version is displayed as below, it is ready to use (the numbers vary by environment).

Python 3.9.6
Tip: If you see "python3 not found" and the Command Line Tools installation dialog appears (described below), installing it will give you both Python 3 and git. To use the latest version of Python, you can also install it from the official Python website or via Homebrew (brew install python).

2. Installing git

You use git to fetch the sample collection (ailia-models) from GitHub. First check whether it is installed.

git --version

If a version is displayed, you can use it as is. If it is not installed, running the following command will show a dialog prompting you to install the Xcode Command Line Tools (a developer toolset that includes git and Python 3).

xcode-select --install

Click "Install" in the dialog, and once it completes, run git --version again to confirm the version is displayed.

Tip: If you use Homebrew, you can also install the latest git with brew install git.

3. Checking and updating pip

pip comes bundled with Python, so there is no need to install it separately. First confirm that it is available.

pip3 --version

An outdated pip can cause installation failures, so we recommend updating it to the latest version.

python3 -m pip install --upgrade pip

4. Installing and running ailia SDK

Once Python, pip, and git are in place, you can finally install ailia SDK. Run the following in Terminal.

pip3 install ailia

Next, let's clone the sample collection and run it.

git clone https://github.com/ailia-ai/ailia-models.git
cd ailia-models
pip3 install -r requirements.txt
cd object_detection/yolox
python3 yolox.py -v 0

If object detection results are overlaid on your webcam feed, it worked. For more details on how to use it, see the ailia SDK getting started page.

Next steps: On macOS, the GPU (Metal) is used automatically on both Apple Silicon and Intel.