pyGame on a Mac

Hi blenders,

This morning i was trying to get pyGame running on a mac. I had to spend several hours, maybe because i did not find the right post, or maybe because im not too smart. Anyway, i will share what i did to get it working straight ahead so that anybody else can do it much faster.

BTW I’m on blender 2.49 ! this might not apply for blender 2.5
I’m on 10.6 but this should not matter.

  1. Download and install python 2.5 (you have it already but do it, you need it):

  2. Download and install pygame:

  3. go to your pygame folder and copy it to your blender scripts folder.
    • Your pygame folder is hidden here:
    • Your blender scripts folder might be hidden somewhere like here:
    (remember to right click and “show package contents” to navigate inside an app)

  4. Put a sound file (.ogg) next to your blender file.

  5. Once this is done you should b able to run pygame… try something like this:

import pygame.mixer                                           
import os

pygame.mixer.init()                                     "YOUR_SOUND_FILE.ogg")

if you don’t know where to put this script and how to use it look for a tutorial like this one:

This should work!

I would like to ask if blender 2.5 has improved somehow the sound in GE… i did not find anything related so i assume today we still have to look into pygame to use some features for audio.

Thanks for this forum!

well done!

I think you can add the pygame folder to the module search path by enhancing PYTHONPATH.
So you do not need to copy that folder around.