Programming

(Python) PyOpenGL Installation Notes

steloflute 2013. 2. 2. 13:00

http://choorucode.com/2012/04/27/pyopengl-installation-notes/


PyOpenGL Installation Notes

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 setup.py install. Everything seems to be working fine.

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

1File "C:\Program Files\Python27\lib\site-packages\OpenGL\GLUT\special.py", line 324, in glutInit
2    _base_glutInit( ctypes.byref(count), holder )
3TypeError: '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







'Programming' 카테고리의 다른 글

Python IDLE Themes  (0) 2013.02.04
Github: README and README.md  (0) 2013.02.03
(Python) cx_freeze: make executable  (0) 2013.01.31
Slowloris HTTP DoS  (0) 2013.01.30
(C++) How do I tokenize a string in C++?  (0) 2013.01.28