python找不到GL

时间:2013-03-14 03:45:33

标签: python opengl

尝试在amd64计算机上使用FreeBSD pyglet1.2alpha1python3.3,{/ p>

$ python ~/.local/lib/python3.3/site-packages/pyglet/gl/gl_info.py

Traceback (most recent call last):
  File "~/.local/lib/python3.3/site-packages/pyglet/lib.py", line 111, in load_library
    lib = ctypes.cdll.LoadLibrary(name)
  File "/usr/local/lib/python3.3/ctypes/__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "/usr/local/lib/python3.3/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: Shared object "GL" not found, required by "python"

During handling of the above exception, another exception occurred:
[…]
  File "~/.local/lib/python3.3/site-packages/pyglet/lib.py", line 118, in load_library
    if ((self.linux_not_found_error not in o.message) and
AttributeError: 'OSError' object has no attribute 'message'

我已经通过运行glxgears(工作)测试了我的Mesa安装,我尝试安装PyOpenGL进行比较(这不起作用,因为它取决于PIL,它不适合python3 .3),以确保我在安装python3.3mesa-demos后重新安装freeglut,但仍然没有变化。

python2.7中,我收到相同的错误

OSError: Shared object "GL" not found, required by "python2"

(没有During handling of the above exception, another exception occurred的问题),也是在安装PyOpenGL之后(按预期工作)。

这是什么问题?如何让pyglet起作用?

1 个答案:

答案 0 :(得分:0)

pyglet附带的各种python文件,如果它们在linux上运行,则尝试显式加载外部资源。因此,他们没有在FreeBSD上评估正确的东西。在下面列出的文件中用sys.platform.startswith('linux')替换sys.platform.startswith('linux') or sys.platform.startswith('freebsd')时,它似乎有效。

pyglet/lib.py
pyglet/app/base.py
pyglet/gl/__init__.py
pyglet/image/codecs/__init__.py
pyglet/input/__init__.py
pyglet/media/drivers/openal/__init__.py