284 Appendix B
Pygame for Mac
Installing Pygame on a Mac is more complicated than on a PC.
You have three options:
- If you have access to a Windows PC, you may find it easier
to install the Windows versions of Python and Pygame in
order to run the programs from Chapters 8 through 10. If you
choose this option, follow the steps in “Python for Windows”
on page 264. Then follow the steps in “Pygame for Windows”
on page 280. - You can install an older version of Python, like Python 2.7.9,
along with Pygame 1.9.2 for OS X in order to run the Pygame
programs in Chapters 8 through 10. Installing Python 2.7.9
and Pygame 1.9.2 is easier than making Pygame work with
Python 3.4.2. But there are differences between Python 2
and 3, so for Chapters 1 through 7, I recommend sticking
to Python 3.4.2 to make sure the examples work. Then,
for Chapters 8 through 10, you can use Python 2.7 and
Pygame 1.9.2 to run the Pygame examples. If you choose
this option, follow the steps under “Python 2.7 and Pygame
1.9.2” in the next section. - To install Pygame for Python 3.4 on your Mac, see the instruc-
tions online at http://www.nostarch.com/teachkids/. If you’re
doing this at school or work, you will almost certainly need IT
support. Give your IT professional the online instructions to
use as a guide.
Python 2 .7 and Pygame 1 9 .2
Newer Macs come with a version of Python 2.7 preinstalled by
Apple as part of OS X. But the version of Python that Apple
provides may not work with the Pygame installer. I recommend
installing the latest version of Python 2.7 from http://python.org/
before you try to install Pygame.
- To install Python 2.7 on your Mac, go back to Appendix A and
start following the steps under “Python for Mac” on page 271
again. But this time, instead of downloading the 3.4.2 installer
from the Mac downloads page at http://python.org/, download
and run the 2.7 installer (2.7.9 as of this writing), as shown in
Figure B-9.