Home >Backend Development >Python Tutorial >Why Can't I Install Pygame on My Mac OS X and How Do I Fix the 'SDL.h' Error?
Installation Error with Pygame on Mac OS
While installing the Pygame package, an issue arises with the following error:
fatal error: 'SDL.h' file not found
System Configuration
Resolution
On Mac OS (OSX Mavericks), the Pygame installation can be resolved using the following steps:
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi pip install https://bitbucket.org/pygame/pygame/get/default.tar.gz
Note that the current "default" branch of the Pygame Github repository is on commit e3ae850.
Refer to this StackOverflow discussion for more information: PyGame in a virtualenv on OS X with brew?
The above is the detailed content of Why Can't I Install Pygame on My Mac OS X and How Do I Fix the 'SDL.h' Error?. For more information, please follow other related articles on the PHP Chinese website!