question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'SDL.h' file not found on Mac

See original GitHub issue

python anaconda 3.5 mac os 10.12.5 When install pysc2 by pip install pysc2, get this error.

    running build_ext
    building 'pygame.scrap' extension
    creating build/temp.macosx-10.6-x86_64-3.5
    creating build/temp.macosx-10.6-x86_64-3.5/src
    /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/wzy/anaconda/include -arch x86_64 -DENABLE_NEWBUF=1 -I/NEED_INC_PATH_FIX -I/Users/wzy/anaconda/include/python3.5m -c src/scrap.c -o build/temp.macosx-10.6-x86_64-3.5/src/scrap.o
    src/scrap.c:27:10: fatal error: 'SDL.h' file not found
    #include "SDL.h"
             ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

61reactions
halflingscommented, Aug 12, 2017

@xwzy : This seems to address your issue.

https://stackoverflow.com/questions/41806977/cant-install-pygame-with-pip-as-there-is-an-error-whilst-runningvsetup-py-bdist

pip install pygame==1.9.2

Unsure if pysc2 will work just the same with that version, but worth trying.

Otherwise try this:

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi

If brew still complains, follow these instructions to fix it (you will find homebrew is extremely useful anyway): https://github.com/Homebrew/legacy-homebrew/issues/39170#issuecomment-97367623

5reactions
ttdonovancommented, Aug 11, 2017

@xwzy are you sure you have SDL2 installed? Try using Homebrew to install this package.

$ brew install sdl2
Read more comments on GitHub >

github_iconTop Results From Across the Web

SDL2 headers not being found when compiling os x
Does find /Library/Frameworks/SDL2.framework -name "SDL.h" find that header file? Is it under an SDL2 directory or somewhere else? – Drew MacInnis.
Read more >
Mac OSX Bug: Where's "SDL.h"? - Simple Directmedia Layer
I just downloaded the Mac OSX version of SDL-1.2.8. There does not seem to be an "SDL.h" file.
Read more >
SDL2 is not found on OSX : r/Zig - Reddit
I cloned this SDL2 demo to get the ball rolling. When I run zig build, I get an error. /src/main.zig:1:11: error: C import...
Read more >
[Setup] SDL Mac (Including M1) Setup with Simple ... - YouTube
SDL2 Playlist: https://www.youtube.com/playlist?list=PLvv0ScY6vfd-p1gSnbQhY7vMe2rng0IL0▻ Find full courses on: ...
Read more >
Unable to Build on Mac OS (#97) · Issues · David Griffith / frotz
sf_util.c:8:10: fatal error: 'SDL.h' file not found #include <SDL.h> ^~~~~~~ 1 error generated. make[1]: *** [sf_util.o] Error 1 make: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found