本来以为神器brew install pygame就ok,谁知道不是这么回事儿,折腾如下
一、首先要装pip(这个osx没有,brew也没找到)
1、下载https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python ez_setup.py
2、下载https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
二、再装pygame
1、下载Xquartz去安装
2、brew install mercurial
3、sudo pip install nose
4、brew install gfortran
5、brew tap homebrew/headonly
6、brew install --HEAD smpeg(编译巨慢)
7、brew install sdl sdl_mixer sdl_image sdl_ttf portmidi
8、sudo pip install hg+http://bitbucket.org/pygame/pygame
三、测试
1、phthon
2、import pygame(如果没有什么信息show出来,恭喜成功了!)
环境:osx 10.8.4,python2.7.2。我想10.8.x应该都可以的
一、首先要装pip(这个osx没有,brew也没找到)
1、下载https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python ez_setup.py
2、下载https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
二、再装pygame
1、下载Xquartz去安装
2、brew install mercurial
3、sudo pip install nose
4、brew install gfortran
5、brew tap homebrew/headonly
6、brew install --HEAD smpeg(编译巨慢)
7、brew install sdl sdl_mixer sdl_image sdl_ttf portmidi
8、sudo pip install hg+http://bitbucket.org/pygame/pygame
三、测试
1、phthon
2、import pygame(如果没有什么信息show出来,恭喜成功了!)
环境:osx 10.8.4,python2.7.2。我想10.8.x应该都可以的