1

I decided to look into Pyglet to experiment with graphics and hit the ground face first with some errors. Right off the bat, I had issue simply trying to create a window. I would get multiple errors due to the fact that I was using the 64-bit version of Python. I've switched to 32-bit, and whittled down the errors to this one:

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    window = pyglet.window.Window()
  File "C:\Python27\lib\site-packages\pyglet\window\win32\__init__.py", line 423, in __init__
    super(Win32Window, self).__init__(*args, **kwargs)
  File "C:\Python27\lib\site-packages\pyglet\window\__init__.py", line 686, in __init__
    self._create()
  File "C:\Python27\lib\site-packages\pyglet\window\win32\__init__.py", line 518, in _create
    self.context._set_window(self)
  File "C:\Python27\lib\site-packages\pyglet\window\win32\__init__.py", line 364, in _set_window
    raise gl.ContextException('Unable to share contexts')
ContextException: Unable to share contexts

The error was caused by this line of code, which is the first line in the Pyglet tutorial on their website (omitting the import):

window = pyglet.window.Window()

It's worth noting that I have two monitors. According to the Pyglet documentation, it shouldn't be a problem as it chooses default values, but I don't want to rule it out.

EDIT: I'm working on Windows 7 64-bit.

4

0 回答 0