PyOpenGL GLUT error

share on google plus share on facebook share on twitter share on linkedin share via email

PyOpenGL is a very useful Python binding to OpenGL. It can be easily installed via pip from the command line:

pip install PyOpenGL PyOpenGL_accelerate

However, the official (Windows) release does not install the OpenGL Utility Toolkit.

This usually causes an error when importing:

from OpenGL.GL import *

of the type:

OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit

One quick solution is not to install as explained above, but to first download the Unofficial Windows Binaries for Python Extension Packages, and then pip install from the command line. The .whl file name will be different depending on your system, in my case:

pip install PyOpenGL-3.1.1-cp27-cp27m-win_amd64.whl

This version includes OpenGL.GLUT.

One Response to “PyOpenGL GLUT error”

Leave a response

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>