mac下使用pip安装pygame包报错解决

报错1:

解决1:

xcode-select --install

 

报错2:

src_c/_pygame.h:216:10: fatal error: 'SDL.h' file not found

解决2:

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi

最后安装正常: