Skip to content

Instantly share code, notes, and snippets.

@connorshea
Last active June 15, 2022 23:54
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connorshea/f539c91f210e72077ca9 to your computer and use it in GitHub Desktop.
Save connorshea/f539c91f210e72077ca9 to your computer and use it in GitHub Desktop.
Installing Homebrew, Python, and Pygame on OS X
  1. Open the Terminal.
  2. Install Homebrew.
  1. 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.
  1. Install prerequisites for pygame: brew install sdl sdl_image sdl_mixer sdl_ttf portmidi mercurial
  2. Install pygame using pip with pip install hg+http://bitbucket.org/pygame/pygame
  3. Install numpy and matplotlib using pip install numpy matplotlib

Then you can run Python scripts from the Terminal with python filename.py.

Why use Homebrew? So when you install things you can easily remove and reinstall them if they break, remove them if they're misbehaving or you no longer need them, or update your packages whenever updates come out (you can do that with brew update then brew upgrade). It also makes installing all kinds of languages and things super easy.

@vian21
Copy link

vian21 commented Jul 31, 2018

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment