Comment #3 on issue 1916 by smichr: Plotting fails: Window initialization failed: Unable to share contexts
http://code.google.com/p/sympy/issues/detail?id=1916

If I do the following I get a plot:

from sympy import *
from sympy.thirdparty import import_thirdparty
pyglet = import_thirdparty("pyglet")
import pyglet.gl
import pyglet.window

from sympy import symbols, sin, cos
x,y = symbols('xy')
p=Plot(x, [x, -5, 5, 4], visible=True)
p.wait_for_calculations()
pyglet.app.run()

...but I also get the following error message:

Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
    exec codeObject in __main__.__dict__
File "C:\Documents and Settings\chris\sympy\my\foo.py", line 11, in <module>
    pyglet.app.run()
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\app\__init__.py", line 264, in run
    EventLoop().run()
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\app\win32.py", line 74, in run
    self._timer_func(0, 0, timer, 0)
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\app\win32.py", line 84, in _timer_func
    sleep_time = self.idle()
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\app\__init__.py", line 192, in idle
    window.switch_to()
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\window\win32\__init__.py", line 556, in switch_to
    self._context.set_current()
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\gl\__init__.py", line 342, in set_current
    self._info.set_active_context()
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\gl\gl_info.py", line 91, in set_active_context
    self.vendor = cast(glGetString(GL_VENDOR), c_char_p).value
File "C:\Documents and Settings\chris\sympy\sympy\thirdparty\pyglet\pyglet\gl\lib.py", line 105, in errcheck
    raise GLException(msg)
GLException: invalid operation

If I re-run without the app.run() it runs and doesn't print the error. But if I don't include it the first time (and get the above error) then I get the same "initialization failed" error message.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to