尝试在amd64计算机上使用FreeBSD pyglet1.2alpha1
和python3.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.3
和mesa-demos
后重新安装freeglut
,但仍然没有变化。
在python2.7
中,我收到相同的错误
OSError: Shared object "GL" not found, required by "python2"
(没有During handling of the above exception, another exception occurred
的问题),也是在安装PyOpenGL
之后(按预期工作)。
这是什么问题?如何让pyglet
起作用?
答案 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