Installing Pygame with pygame.movie on Mavericks

Notes To Self…

… and just in case some other poor soul is struggling with this and searches for the error message…like I did.

I was trying to play a video using pygame.movie and getting…

NotImplementedError: movie module not available

(ImportError: No module named movie)

 

After trawling around and trying every option out there, brew, pip, hacking source compilation… I found this approach actually worked. For me.

 

a. Install MacPorts

 

b. >>> sudo port install py-game @1.9.1_8

 

c. In the terminal add…

 

export PYTHONPATH=”/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:$PYTHONPATH”

 

Now I get …

 

>>> import pygame.movie

>>> pygame.movie

<module ‘pygame.movie’ from ‘pygame/movie.so’>

 

And it seems to play movies fine. As long as you’ve converted it with ( you might need to go get ffmpeg too)  …

 

ffmpeg -i <infile> -vcodec mpeg1video -acodec libmp3lame -intra <outfile.mpg>

 

… otherwise you get …

 

Python(37671,0x7fff762f1310) malloc: *** error for object 0x7ff37408a608: incorrect checksum for freed object – object was probably modified after being freed.

*** set a breakpoint in malloc_error_break to debug

 

… and a crash.

 

Leave a Reply

Your email address will not be published. Required fields are marked *