如何在Mac上安装pygame(How to install pygame on Mac)

如果按照《python从入门到实践》来操作可能会出现下图的情况如何在Mac上安装pygame(How to install pygame on Mac)在python从入门到实践中的安装教程存在一些错误,因此找了一种可行性和适应性更好的安装方式。
在mac终端中输入
sudo xcode-select --install
再输入
python shouei$ python get-pip.py
然后输入“sudo pip install pygame”,就可以进入安装2.7版本的pygame,“sudo pip3 install pygame”则进入3.版本的Pygame。