Install Python 3 & Pygame on Mac OS X Yosemite

This tutorial has been updated from Mavericks to Yosemite. I have tested it and it works perfectly.

Install the Xcode Command Line Tools from Apple. Apple now provides an official Command Line Tools for Xcode package that you can install without needing to install Xcode itself. You can install it with xcode-select –install on Mavericks and Yosemite or download it from Apple’s developer site (free registration required) and search for “Command Line Tools”

Install Quartz from here

Install Homebrew and necessary tools:

ruby -e “$(curl -fsSL”

brew update

brew install python3 (this currently installs version 3.4.3_2)

brew install mercurial

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
brew tap homebrew/headonly
brew install smpeg

Clone the pygame repository:

cd /Users/YourName/Downloads
hg clone
cd pygame
cd src

Copy this file into src, replacing the one there.

Install Pygame:

/usr/local/Cellar/python3/3.4.3_2/bin/pip3.4 install /Users/YourName/Downloads/pygame

That’s it. You can test your install by opening idle3 app located in:
then type: import pygame [hit return]
if there is no error, you were successful.

If this tutorial helped you, please follow me on twitter @dudeslife .