Skip to content

Compiling on macOS

Ankith edited this page Jun 29, 2024 · 6 revisions
  1. Install Homebrew if you don't already have it:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install the pygame-ce dependencies with Homebrew:

    brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf pkg-config portmidi
    
  3. Clone/Checkout the repository from github (if you have git you may use the following command)

    git clone https://github.com/pygame-community/pygame-ce
    
  4. Clone and install pygame-ce from source:

    python3 -m pip install .
    
  5. That's it! You may also check out the Advanced compilation guide (for developers) if you are getting into development or are running into issues.

Note:

If compiling gives you an error that says something like invalid conversion between vector type '__m64'... while you're on an Intel-based Mac, then try compiling after setting this environment variable

export ARCHFLAGS="-arch x86_64"

source