Python pigment and opengl
I am trying to get 3D capabilities through python and download pyglet. After going through the first example in this tutorial , I got a bunch of strange errors that I cannot distinguish between. The following is the script I am trying to run:
import pyglet
win = pyglet.window.Window()
@win.event
def on_draw():
win.clear()
pyglet.app.run()
2 Below is the output I got from the python interpreter after I imported my script:
>>> import test as t
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "test.py", line 13, in <module>
pyglet.app.run()
File "/usr/lib/pymodules/python2.7/pyglet/app/__init__.py", line 264, in run
EventLoop().run()
File "/usr/lib/pymodules/python2.7/pyglet/app/xlib.py", line 93, in run
sleep_time = self.idle()
Fihttp://greendalecs.wordpress.com/2012/04/21/3d-programming-in-python-part-1/#commentsle "/usr/lib/pymodules/python2.7/pyglet/app/__init__.py", line 193, in idle
window.dispatch_event('on_draw')
File "/usr/lib/pymodules/python2.7/pyglet/window/__init__.py", line 1219, in dispatch_event
EventDispatcher.dispatch_event(self, *args)
File "/usr/lib/pymodules/python2.7/pyglet/event.py", line 340, in dispatch_event
if handler(*args):
File "test.py", line 13, in on_draw
pyglet.app.run()
NameError: global name 'GL_COlOR_BUFFER_BIT' is not defined
- How can I fix these errors? I am using Ubuntu 12.04 LTS and Emacs 24.3.
- I downloaded pyglet via
apt-get install
, but is there anything else I needed to do? Maybe I don't have any configured drivers or I need other software.
If you need more information, let me know!
0
source to share
2 answers
In the future, starting with Pyglet 1.1.4, this is because 1.1.4 no longer supports the "latest" versions of Mac OS.
However, the newest unreleased version of Pyglet support DOES with a complete new interface using Cocoa. So, until Pyglet 1.2 is released, you have to install Pyglet directly from external line using for example
pip install --upgrade http://pyglet.googlecode.com/archive/tip.zip
0
source to share