This works fine in python 2.7, but it fails in 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'
It seems that for some reason it can't load swrast_dri.so
. I tried adding the path to that library:
$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/dri:$LD_LIBRARY_PATH
But this did not help. Any idea?
Note: I'm running on Debian:
$ cat /etc/debian_version
8.6
Edit
I just checked, everything works fine with the system python 3. So it seems to be an issue with the combination of Anaconda + the system's opengl libraries. I'm guessing they were not compiled with the same standard libraries or something. I tried running:
$ conda install -n python3 pyopengl
Installation went fine but I still get the same bug.