Search code examples
macossdlosx-maverickspysdl2

Problems setting up pySDL2 on mac os x 10.9


I am having trouble setting up PySDL2 on my macbook pro running OSX 10.9. I downloaded and installed SDL 2.0.1 and I am trying to follow the PySDL2 tutorial here: http://pysdl2.readthedocs.org/en/latest/integration.html

I do not know what to do when it says "it is also possible to set the environment variable PYSDL2_DLL_PATH, which shall point to the directory of the SDL2 library." I tried running "export PYSDL2_DLL_PATH=/Library/Frameworks", but I don't know if that's what I'm supposed to do. Currently when I try to run this code:

import sys

try:
    import sdl2.ext as sdl2ext
except ImportError:
    import traceback
    traceback.print_exc()
    sys.exit(1)

from sdl2.ext import Resources
RESOURCES = Resources(__file__, "resources")

I get the error "ImportError: No module named 'sdl2'" So how do I properly set this up?

Edit: Using macports I got things setup correctly. Thank you sirs.


Solution

  • Have you tried installing it via macports?

    $ sudo port install py-SDL