Skip to content

On MacOS, I get an error about SDL.h for pygame dependency when installing PyRat #27

@BastienPasdeloup

Description

@BastienPasdeloup

If you get this error:

Building wheels for collected packages: pygame
  Building wheel for pygame (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pygame (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      src_c/_sdl2/sdl2.c:1237:10: fatal error: 'SDL.h' file not found
       1237 | #include "SDL.h"
            |          ^~~
      1 error generated.
      Skipping Cython compilation

      ---
      For help with compilation see:
          https://www.pygame.org/wiki/MacCompile
      To contribute to pygame development see:
          https://www.pygame.org/contribute.html
      ---

      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygame
Failed to build pygame
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> pygame

Please install the following packages (adjust versions 2/3 if needed):

brew install sdl sdl3_image sdl2_mixer sdl3_ttf portmidi

Metadata

Metadata

Assignees

No one assigned

    Labels

    during installationProblems that appear when installing PyRatosxFor issues on OSXsolvedThis problem has a solution

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions