在使用Xvfb的无头服务器上运行时,Pyglet无法在Python 3(Anaconda)中加载swrast_dri.so

loading...


3

这在python 2.7中工作正常,但它在python 3.5(Anaconda)中失败:

$ xvfb-run -s "-screen 0 1400x900x24" ./anaconda2/envs/python3/bin/python

Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> from pyglet.gl import gl_info

libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Traceback (most recent call last):
  (...)
  File "(...)/pyglet/gl/gl_info.py", line 92, in set_active_context
    self.vendor = asstr(cast(glGetString(GL_VENDOR), c_char_p).value)
  File "(...)/pyglet/compat.py", line 88, in asstr
    return s.decode("utf-8")
AttributeError: 'NoneType' object has no attribute 'decode'

似乎由于某种原因它无法加载 swrast_dri.so . 我尝试添加该库的路径:

$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/dri:$LD_LIBRARY_PATH

但这没有帮助 . 任何的想法?

注意:我在Debian上运行:

$ cat /etc/debian_version
8.6

Edit

我刚刚检查过,一切正常,系统python 3.所以这似乎是Anaconda与系统的opengl库组合的一个问题 . 我猜他们没有使用相同的标准库或其他东西进行编译 . 我试过跑:

$ conda install -n python3 pyopengl

安装顺利,但我仍然得到相同的错误 .

0回答

No Data

loading...

评论

暂时没有评论!