Minecraft icon indicating copy to clipboard operation
Minecraft copied to clipboard

pyglet.gl.ContextException: Could not create GL context on Python3.4

Open phiresky opened this issue 10 years ago • 6 comments

Works flawlessly with python2, but with python3 this error appears:

> python3 main.py
Traceback (most recent call last):
  File "main.py", line 7, in <module>
    from pyglet.gl import *
  File "/usr/lib/python3.4/site-packages/pyglet/gl/__init__.py", line 236, in <module>
    import pyglet.window
  File "/usr/lib/python3.4/site-packages/pyglet/window/__init__.py", line 1816, in <module>
    gl._create_shadow_window()
  File "/usr/lib/python3.4/site-packages/pyglet/gl/__init__.py", line 205, in _create_shadow_window
    _shadow_window = Window(width=1, height=1, visible=False)
  File "/usr/lib/python3.4/site-packages/pyglet/window/xlib/__init__.py", line 163, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/pyglet/window/__init__.py", line 515, in __init__
    context = config.create_context(gl.current_context)
  File "/usr/lib/python3.4/site-packages/pyglet/gl/xlib.py", line 186, in create_context
    return XlibContextARB(self, share)
  File "/usr/lib/python3.4/site-packages/pyglet/gl/xlib.py", line 300, in __init__
    super(XlibContext13, self).__init__(config, share)
  File "/usr/lib/python3.4/site-packages/pyglet/gl/xlib.py", line 203, in __init__
    raise gl.ContextException('Could not create GL context') 
pyglet.gl.ContextException: Could not create GL context
> uname -a 
Linux 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux

phiresky avatar Apr 15 '15 15:04 phiresky

@phiresky, only guessing, but I assume between py2.7 and py3.x the API for pyglet changed. Honestly at this point, this repository is all but dead. A fork and port to py3 would be beneficial.

Aareon avatar Oct 31 '17 17:10 Aareon

@Aareon It works for me on Python3.5.

progval avatar Oct 31 '17 19:10 progval

@phiresky @ProgVal what graphics cards do y’all have? I’ve read some information about Nvidia cards not playing well with Pyglet/GL

Aareon avatar Oct 31 '17 19:10 Aareon

Could just be that your card doesn’t support the version of GL that it needs

Aareon avatar Oct 31 '17 19:10 Aareon

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)

progval avatar Oct 31 '17 19:10 progval

it doesn't work on python 3.8 know…

airbus330300 avatar Mar 23 '22 14:03 airbus330300