[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Python 2.7 with pygame on Mac Sierra (10.12.2)



Hi, 

First time poster.  I hope I'm doing this correctly.

I teach Python at colleges in the San Francisco Bay Area.  And I have been using Python and pygame for a number of years.  ... And I'm a Mac guy.  I have had a stable Python & pygame environment for a number of years.  (Using 32 bit Python and pygame 1.9.1 on Mac 10.10).

For a number of reasons, I decided to upgrade my Mac OS to the latest version, 10.12.  Since then I have not been able to get pygame working.  I first ran into a problem trying to use any fonts.  Researching the issue, I found this link:  https://bitbucket.org/pygame/pygame/commits/bf49fd02a920  (from 2013) that shows a minor change to a python file (sysfont.py).  That fixed the font problem.

But now, I have run into a problem trying to use any sound.  In my typical programs, I typically load a sound like this:

        someSound = pygame.mixer.Sound("sounds/someSound.wav")

But when I try to run that with this new set up, I get this:

Traceback (most recent call last):
  File "/Users/irvkalb/Desktop/MyProgram.py", line 219, in <module>
    someSound = pygame.mixer.Sound('sounds/someSound.wav')
error: mixer system not initialized

If I try making a call to initialize the sound mixer:

pygame.mixer.init()

I get this:

Traceback (most recent call last):
  File "/Users/irvkalb/Desktop/SlotMachine/OO-SlotMachines.py", line 11, in <module>
    pygame.mixer.init()
error: Failed to start CoreAudio: AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)

Doing some research on that leads to listing of a C file "SDL_coreaudio.c".  But I don't want to track down and correct any C code.


My question is:  Is there a simple way to install Python 2.7 with a working version of pygame, to run on Mac Sierra?  If so, can someone please let me know how to do this?

I am looking for a series of steps that I can explain to my students - who are typically art students, who have absolutely no background in Unix commands, so anything involving Unix commands is not feasible.


Also, when looking to find the latest version of pygame, on the pygame downloads site, I see version 1.9.1.  But if I go to PyPi at 
      https://pypi.python.org/pypi/Pygame#downloads

It shows version 1.9.2.   But that shows a wheel file (.whl).   

Can anyone tell me if this is a more recent version that might fix the problems that I am seeing?  And if so, is there a simple way to install a .whl file without going through a terminal prompt?


Sorry for so many questions, but getting the environment set up so that it is usable on the latest version of the Mac OS has been painful.

Thanks in advance,

Irv