- Open the Terminal.
- Install Homebrew.
- If you run into issues with OS X El Capitan, this will help.
- Enable the Xcode Command Line Tools, necessary for installing/compiling Homebrew:
xcode-select –install
- Then install Homebrew itself:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install Python 2.7 with
brew install python
- Optionally you can also install Python 3 with
brew install python3
- Installing either of these with install pip and pip3 respectively, a package manager for Python.
- Install prerequisites for pygame:
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi mercurial
- Install pygame using
pip
withpip install hg+http://bitbucket.org/pygame/pygame