网站首页 Python Mac安装Pygame遇到的坑
1、通过brew安装依赖包
brew install sdl smpeg sdl_image sdl_mixer sdl_ttf portmidi hg sdl_mixer portmidi
安装报错
Error: The following formula
[#<Dependency: "python@2" []>, #<Options: []>]
cannot be installed as binary package and must be built from source.
Install the Command Line Tools:
xcode-select --install
解决方法:
xcode-select --install
安装报错
Error: An unexpected error occurred during the `brew link` step
解决办法
1):尝试创建Frameworks文件夹
sudo mkdir /usr/local/Frameworks
2):更改目录权限
sudo chown -R $(whoami) /usr/local/Frameworks
2、安装XQuartz
3、通过pip3安装Pygame
pip3 install --user hg+http://bitbucket.org/pygame/pygame
4、python3 -m pygame.examples.aliens
转载请注明出处!