我承认我完全被 python 安装弄傻了。有人可以帮助我如何安装模块
我想玩 PyGame、PyOpenGL 等。所以我安装了它们,但每次我输入“import pygame”时都会出现错误消息。
到目前为止,这是我的环境。
在 .bash_profile
PATH=${PATH}:/System/Library/Frameworks/Python.framework/Versions/Current/bin
使用 easy_install PyOpenGL 放置了这个
/Library/Python/2.5/site-packages/PyOpenGL-3.0.0b8-py2.5.egg
定位 pygame 模块
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
当我运行 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