OpenGL Resources

Updated on Jan 6  2018


OpenGL and Python

Deborah R. Fowler



OpenGL and Python

Updated on  March 18 2013 
Updated on Jan 6  2018

click here for OpenGL

click here for summary table of compiling


Using Python and OpenGL/GLUT on Windows:

You can use OpenGL/freeglut with python! You will need to download pyOpenGL. You can download the same version of freeglut as you did for C++ and place the files as you did previously. Instructions here.

TIP:  Do not use the official release of pyOpenGL - this does not work on Windows - you will need to use the unofficial version. I discovered this the hard way as have other users (https://codeyarns.com/2012/04/27/pyopengl-installation-notes-for-windows/)

The official version will give an error as described below. (I tried the official release version a few years back on two different machines, went through all the top google suggestions and still had):

File "C:\Python27\lib\site-packages\OpenGL\GLUT\special.py", line 324, in glutInit
    _base_glutInit( ctypes.byref(count), holder )
TypeError: 'NoneType' object is not callable

Using this site here, scroll down to the version (or search for PyOpenGL). As of 01/06/2018 I have tested this using PyOpenGL-3.1.1-cp27-cp27m-win-amd64.whl and it worked great! (I'm using python 2.7).

To install a whl file open a cmd window, cd to the directory of the whl file and type:
pip install nameOfFile.whl

There are a couple of example files you can use to test from a forum discussion code here and here. (I tested on Window 10 on my home desktop in IDLE 01/06/2018).