Update: July 7, 2010:For the past year or so I've been using virtualenv , virtualenvwrapper , and pip to manage and install python packages, and I highly encourage everyone to use these tools! It may take a bit to learn how to use these tools, but once you do, the rewards are great! (especially when using 3rd party python libraries on Mac OS X).
To install PyOpenGL using the aforementioned tools, you'd simply do the following.Create a virtual environment for your OpenGL installation. I'm naming it "gl": mkvirtualenv gl Then use pip to install PyOpenGL: pip install pyopengl
That's all there is to it! I grabbed the demo apps from http://pypi.python.org/pypi/PyOpenGL-Demo , and verified that the gears.py script works, so this should get you started.
I'm leaving the old post below, but again, check out virtualenv and pip. You'll be happy that you did!
I actually got this working quite a while ago, but for some reason I've gotten busy and never documented it. In fact, installing PyOpenGL was almost so easy it's not even worth mentioning... Except... it was so easy, so it's worth mentioning!
Here are the steps to install PyOpenGL on Mac OS X (10.4.10):You'll need to get setuptools, and the easiest way to do that is with EasyInstall (see http://peak.telecommunity.com/DevCenter/EasyInstall ). You'll download the ez_setup.py file, and just run: python ez_setup.py . Download PyOpenGL from their download page . (Side Note: I also grabbed the OpenGLContext). Now, once you untar/unzip it, you should have a PyOpenGL/ directory. Just open a Terminal, cd into that directory, and run python setup.py build . Once that is finished, run python setup.py install Now, do the same for OpenGLContext...
本文开发（python）相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程