PyOpenGL on OS X

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):

  1. 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.

  2. 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

  3. Now, do the same for OpenGLContext...

3 comments:

toby said...

Yeaaaahh !

thanks man - it tooks me 2 hours without your guide and success.
And 40 seconds with this straight steps.

i have to mention:: its recommended to install tools from the osx terminal - and not to try it with macpython IDLE Shell.
this just gives confusing errors.

fantastic - the GPU powered world opens for me.

Brad said...

Thanks for the feedback toby. I almost never use the macpython IDLE shell, so it's good to know that you might have problems with that. Just to let anyone new to python or Mac OS X know, you can find the OS X Terminal under Applications/Utilities/Terminal.app (I remember that it took me a while to find it when I switched to the mac :))

toby said...

to complete this little beginner guide::

+ Install Python 1.5.x (Mac)
+ For Tiger 10.4 install Apple Developer Tools 2.5
minimal "Command Line Support"
(Compiler&Tools + Mac OS X Head&Libs)
+ install easy_install
http://peak.telecommunity.com/DevCenter/EasyInstall
+ open the Terminal and Type "easy_install" + PackageName
Numpy, PyOpenGL, OpenGLContext, GLUT
- Some Packages are not supported by simple easy_install
download them and try "setup.py build" + "setup.py install"
in the terminal. ( PIL for example )

I just want to program some GPU Graphics - dont want to do it in Java / Processing / VVVV / MaxMspJitt.

i will try also http://www.panda3d.org/
but i think GLUT is a good start.