mac os中的pygame安装问题

J4c*_*4cK 19 python pygame

我有以下安装pygame包的问题.

In file included from src/_numericsurfarray.c:23:
src/pygame.h:106:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
         ^
1 error generated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

系统信息

  • Mac OS-10.9.2
  • python版本 - Python 2.7.5 :: Anaconda 1.6.1(x86_64)

任何建议都会非常感激?谢谢.

ala*_*jds 27

在这里(OSX Mavericks)我能够以这种方式安装:

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
pip install https://bitbucket.org/pygame/pygame/get/default.tar.gz
Run Code Online (Sandbox Code Playgroud)

("默认"分支现在在提交e3ae850上)

资料来源:https://bitbucket.org/pygame/pygame/issue/139/sdlh-not-found-even-thought-it-exists#comment-3822470

另见StackOverflow这个问题:PyGame在OS X上的virtualenv中使用brew?

  • 只是`brew install sdl`似乎已经足够了,但我想有些部分不会起作用. (6认同)