Search code examples
pythonubuntuimporterrorpyglet

Pyglet: Library "GL" not found


I tried installing pyglet with sudo python setup.py install and with sudo apt-get install python-pyglet but I had no luck running a simple script. I am with Ubuntu 11.10 64-bits.

File "test.py", line 3, in <module>
window = pyglet.window.Window()
File "/usr/local/lib/python2.7/dist-packages/pyglet/__init__.py", line 306, in __getattr__
__import__(import_name)
File "/usr/local/lib/python2.7/dist-packages/pyglet/window/__init__.py", line 133, in <module>
from pyglet.gl import gl_info
File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/__init__.py", line 99, in <module>
from pyglet.gl.lib import GLException
File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/lib.py", line 143, in <module>
from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX
File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/lib_glx.py", line 48, in <module>
gl_lib = pyglet.lib.load_library('GL')
File "/usr/local/lib/python2.7/dist-packages/pyglet/lib.py", line 122, in load_library
raise ImportError('Library "%s" not found.' % names[0])
ImportError: Library "GL" not found.

Solution

  • It's probably a problem with your graphics drivers. You could try installing the dev packages for whatever graphics driver you are using, look for packages with dev and one of fglrx(amd), nvidia or mesa(open source) in the name. You probably also want to install freeglut.

    Now as always be careful messing around in the package manager it is an easy way to break your system.