Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyOpenGL ubuntu 14.04: undefined function error

After upgrading to ubuntu 14.04 and installing PyOpenGL via pip. It worked fine under ubuntu 12.04, but now I get errors every time I try to use a function from OpenGL.GLUT, e.g. this

from OpenGL.GLUT import *
print bool(glutInit)
glutInit(sys.argv)

will print out "True" and an error message:

File "/usr/local/lib/python2.7/dist-packages/OpenGL/GLUT/special.py", line 333, in glutInit
_base_glutInit( ctypes.byref(count), holder )
File "/usr/local/lib/python2.7/dist-packages/OpenGL/platform/baseplatform.py", line 407, in __call__
self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

I don't understand it, any suggestions? Thanks.

like image 992
Nicor Lengert Avatar asked Dec 08 '14 11:12

Nicor Lengert


1 Answers

It is working after I installed the python opengl package

sudo apt-get install python-opengl

Before that I installed it via pip leading to the error above:

pip install PyOpenGL PyOpenGL_accelerate

I still don't know why, but it is working now.

like image 116
Nicor Lengert Avatar answered Oct 06 '22 19:10

Nicor Lengert