Sait Sait - 3 months ago 8x
Python Question

Installing pygame with homebrew

I am trying to install pygame for Python3 using Homebrew. (I have both Python 2 and Python 3 on my machine.)

I used this Reddit page, which says:

brew tap Homebrew/python
brew update
brew install pygame

This works perfect and installs
successfully on my Python 2.7. However, Python 3 still does not have

I also found that I can do it using
. However, I am looking for a way to install pygame for Python 3 using Homebrew.

cel cel

Adding --with-python3 is the key here. You can install via brew install --with-python3.

In general brew info <package-name> will give you additional information. In this case brew info pygame prints:

homebrew/python/pygame: stable 1.9.2a0, HEAD
Not installed
==> Dependencies
Required: sdl ✔, sdl_image ✔, sdl_mixer ✔, sdl_ttf ✘, smpeg ✘, jpeg ✔, libpng ✔, portmidi ✘, homebrew/python/numpy ✘, freetype ✔
==> Options
    Build with python3 support
    Build without python2 support
    Install HEAD version