2011-10-29 60 views
1

我嘗試安裝pyglet與sudo的蟒蛇的setup.py安裝sudo易於得到安裝python-pyglet但我沒有運氣運行一個簡單的腳本。我與Ubuntu 11.10 64位。Pyglet:庫「GL」找不到

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. 
+0

您應該學會閱讀並信任錯誤消息:'ImportError:Library「GL」not found.'。 – Kev

回答

1

這可能是您的圖形驅動程序的問題。您可以嘗試安裝您使用的任何圖形驅動程序的開發包,查找名稱中包含dev和fglrx(amd),nvidia或mesa(開放源碼)之一的包。你可能也想安裝freeglut。

現在一如既往地小心在包管理器中亂搞,這是一種打破系統的簡單方法。

+1

_freeglut-dev_解決了問題。謝謝! – cdesseno