pyglet.gl.ContextException: Could not create GL context
I am using a Raspberry Pi and running Pyglet 2.0.7, Python 3.9. When I run main.py, I am given the error "pyglet.gl.ContextException: Could not create GL context". I saw something saying that some apps may not work right with the new version of Pyglet. Thank you for your work, and, in advance, for your help.
That's possible (@Jukitsu can you provide input on this?), but it could also be RPI-related as I haven't yet tested this on the Raspberry. Could you tell us if it's a VC4 or a VC6 Raspberry, as well as which drivers you're using?
I am not running any extra drivers except for the default ones, and I do not remember what VC# means.
what model raspberry is it?
Raspberry Pi 4, Model B ARM64 Cortex CPU, 8 GB RAM.
Okay so I've looked into this a bit on my side (I'm unfamiliar with the RPI4), and it seems like the Raspberry drivers don't support 3.3. That being said, I'm pretty sure the hardware does support what's needed, as from memory even the previous VC4 does. So you can maybe try forcing an older version in the config in main.py:
config = gl.Config(major_version = 2, minor_version = 1, ...)
Hopefully the newer version of Pyglet won't cause issue too, as I haven't yet played around with that.
Worst case scenario you can always run with LIBGL_ALWAYS_SOFTWARE=1:
LIBGL_ALWAYS_SOFTWARE=1 python3 main.py
But that's using software rendering so not ideal.
Closing this as stale.
I was able to fix the problem. Thanks!