0

尝试pyglet1.2alpha1在 FreeBSD 下python3.3在 amd64 机器上使用,我得到了

$ 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'

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

python2.7,我得到同样的错误

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

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

这里有什么问题?怎么pyglet去上班?

4

1 回答 1

0

各种 python 文件附带pyglet并尝试加载外部资源是否在 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
于 2013-03-14T16:10:12.987 回答