Python Programming from First Principles: Learn to Code, Think Computationally, and Solve Real-World Problems
PDFEPUB
CHAPTER GUIDE · GETTING STARTED

Install on macOS

On this pageDownloadInstallVerifyTest PythonTroubleshooting

Install Python on a Mac using the graphical Anaconda installer.

Download

  1. Open Apple menu → About This Mac and check the chip and macOS version.
  2. Open the Anaconda download page.1 For a supported Apple silicon Mac, choose the macOS graphical installer (.pkg).
  3. Save the installer in Downloads.

Intel Mac: current Anaconda releases no longer target Intel Macs. Check the official compatibility guidance before using an archived Intel installer.2

Install

  1. Open the .pkg file from Finder → Downloads.
  2. Select Continue, read the licence agreement and accept it to proceed.
  3. Review the installation location. The current graphical installer uses /opt/anaconda3.
  4. Select Install and provide the macOS authorisation requested by the installer.
  5. When installation succeeds, close the installer and open a new Terminal window using Spotlight (Command+Space, then type Terminal).

Verify

  1. In Terminal, enter:
conda activate base
conda list
Listing 8 — Activate the installed environment and list its packages.

The second command should display package names and versions.

  1. Check Python:
python --version
Listing 9 — Display the installed Python version.

The result should begin with Python 3; the release number may differ from examples in the book.

Test Python

  1. Start Python:
python
Listing 10 — Open Python’s interactive prompt.
  1. At >>>, type the statement below without the prompt symbols:
print("Hello from Python!")
Listing 11 — Run a first statement on macOS.

The output is:

Hello from Python!
Listing 12 — Expected output.
  1. Enter exit() to return to Terminal.

Troubleshooting

  • conda is not found: reopen Terminal. If necessary, follow the official shell-initialisation instructions for the recorded installation location.
  • Another Python starts: activate base, then use python -c "import sys; print(sys.executable)" to check its location.
  • The installer reports an incompatible package: first check system compatibility. The official guide also documents a destination-permission issue; its Change Install Location… control is shown in Figure 3.3
Official Anaconda documentation screenshot identifying Change Install Location in an older macOS installer.
Figure 3 — The Change Install Location control. Official Anaconda documentation image of the 2023.07-2 installer; its location and disk-space values are not current installation requirements.

  1. Anaconda, Download Anaconda Distribution.↩︎

  2. Anaconda, macOS graphical installer. Includes system compatibility, the Intel Mac support change and shell initialisation. Checked on 22 October 2026.↩︎

  3. Screenshot reproduced from the troubleshooting section of Anaconda’s macOS graphical installer guide.↩︎