AttributeError: module 'pyglet.gl' has no attribute 'glColor3f'

See original GitHub issue
  1. Run this code: https://github.com/viblo/pymunk/blob/master/examples/spiderweb.py
  2. Getting error:
Traceback (most recent call last):
  File "C:/pymunk_proj/spiderweb.py", line 184, in <module>
    pyglet.app.run()
  File "C:\Program Files\Python38\lib\site-packages\pyglet\app\__init__.py", line 107, in run
    event_loop.run(interval)
  File "C:\Program Files\Python38\lib\site-packages\pyglet\app\base.py", line 183, in run
    timeout = self.idle()
  File "C:\Program Files\Python38\lib\site-packages\pyglet\app\base.py", line 244, in idle
    self.clock.call_scheduled_functions(dt)
  File "C:\Program Files\Python38\lib\site-packages\pyglet\clock.py", line 274, in call_scheduled_functions
    item.func(now - item.last_ts, *item.args, **item.kwargs)
  File "C:\Program Files\Python38\lib\site-packages\pyglet\app\base.py", line 154, in _redraw_windows
    window.dispatch_event('on_draw')
  File "C:\Program Files\Python38\lib\site-packages\pyglet\window\__init__.py", line 1327, in dispatch_event
    super().dispatch_event(*args)
  File "C:\Program Files\Python38\lib\site-packages\pyglet\event.py", line 415, in dispatch_event
    if handler(*args):
  File "C:/pymunk_proj/spiderweb.py", line 158, in on_draw
    pyglet.gl.glColor3f(1, 0, 1)
AttributeError: module 'pyglet.gl' has no attribute 'glColor3f'
Error in sys.excepthook:

Original exception was:

OS: Win 10 Python: 3.8 Pymunk: 6.2.0 Pyglet: 2.0.dev9

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
einarfcommented, Nov 20, 2022

Thanks a lot for this. We can finally use debug drawing in arcade now that pyglet 2 is supported/released 😄

1reaction
viblocommented, Nov 17, 2022

Ah, there you said something. That could be a nice solution, let pyglet_util check for pyglet >=2, and if not load the legacy stuff instead. I will try it out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module 'pyglet.gl' has no attribute 'xlib' #113 - GitHub
pyglet version is 1.4.10 and there is an error: module 'pyglet.gl' has no attribute 'xlib' anyone can help me?
Read more >
'pyglet.graphics' has no attribute 'vertex_list' - Stack Overflow
I not sure what is the problem exactly. by the way this the code I'm trying to run. ` from pyglet.gl import *...
Read more >
AttributeError: module 'bgl' has no attribute 'glColor4f'
Blender 2.80 change some Python script API, and one of them is the bgl module. Some attributes has been depleted, you need to...
Read more >
AttributeError: module 'pyglet.font' has no attribute 'Text'
It appears that your graphics card/driver doesn't support opengl shaders, but most likely you're using the windows provided driver and you could ...
Read more >
pyglet.shapes — pyglet v2.0.1
This module provides classes for a variety of simplistic 2D shapes, such as Rectangles, Circles, ... An opacity of 255 (the default) has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found