Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

PyOpenGL Installation Notes for Windows

📅 2012-Apr-26 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ pyopengl ⬩ 📚 Archive

PyOpenGL provides Python bindings to OpenGL, GLU and GLUT libraries.

The painful solution

Assume you are using Python 3.x 64-bit on Windows 7 64-bit. There is no official PyOpenGL package for Python 3.x. Tough luck!

So, you take the pains of installing Python 2.x 64-bit on your OS. You then get the official PyOpenGL package and install it using python install. Everything seems to be working fine.

You write your simple PyOpenGL program, but when you execute it, you get this error:

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

It turns out that there are many problems with the official PyOpenGL package. It does not copy the required DLLs and even if you figure this out and copy them manually it will not work on work properly on 64-bit Windows. So, give up using the official package.

The better solution

Skip the error-prone official PyOpenGL package and get the unofficial PyOpenGL installer from here. Pick the version that matches your Windows version, 32-64-bitness and Python version (2.x or 3.x). Double-click to install and you are done! This is one of those cases where the unofficial builds are far better than the official one. Cheers to Christoph Gohlke for maintaining them 😊

Tried with: Windows 7 64-bit and Python 3.2 64-bit

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧