views:

719

answers:

2

Hi,

I'll admit I'm completely dumbed by python install. Can someone help me on how to install module

I want to play with PyGame, PyOpenGL etc. So I install them, but I everytime I type "import pygame" error message shows up.

here's my environment so far.

In .bash_profile

PATH=${PATH}:/System/Library/Frameworks/Python.framework/Versions/Current/bin

Using easy_install PyOpenGL placed this

/Library/Python/2.5/site-packages/PyOpenGL-3.0.0b8-py2.5.egg

Locating pygame module

dchong:~ danielchong$ locate pygame
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pygame.py
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pygame.pyc

dchong:~ danielchong$ locate pyopengl
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pyopengl.py
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pyopengl.pyc

when I run python

Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygame
+1  A: 

I'm not a huge fan of the default python install on OS X in the first place, mostly because it's usually a pretty old version. I find everything works better if I use the macports package.

easy_install seems to work better with the macports package, but maybe that's just because I'm too lazy to figure out all the nuances of the default install.

From what I can see there, it looks like the path to the packages isn't set correctly. Are you sure you're using the right site-packages directory?

Alex Fort