How to install Python 3 on Mac OS X

How to install Python 3 on Mac OS X

The Mac OS X operating system comes with built‑in Python 2.7 by default. For those who need more than the second version, we will look at how to install Python 3 on a Mac. The third version installs easily and does not conflict with the second.

To install Python 3 on Mac OS X you need:

  1. Open https://www.python.org/.
  2. In the Downloads menu under "Download for Mac OS X", select and download the desired Python version.
  3. Go to the Downloads folder and open the downloaded .dmg file.
  4. Click the file twice (or right‑click and choose "Open with – Installer").
  5. Go through the installation process (remember that Python should be installed only on the disk from which your Mac OS X boots – usually selected by default).
  6. Open a terminal and verify the Python version by running python3.

Python also installs its integrated development environment IDLE and the package installer pip automatically. To use IDLE 3, run idle3 in the terminal. Likewise, to run pip on Python 3 you need to use the pip3 command in the terminal.