I was able to make a minimalist test case for this bug :
import numpy
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from matplotlib.pylab import pcolor
pcolor(numpy.array([[1, 1],[1, 1]]))
The segfault disappears if I put the 3 OpenGL imports after the matplotlib import !
BUT :
- If I add : from gtk.gtkgl.apputils import * at the top (before the other imports), the segfault reappears.
- If I add this line after the imports, I get a new type of error :
Traceback (most recent call last):
File "test.py", line 12, in <module>
pcolor(numpy.array([[1, 1],[1, 1]]))
File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 2077, in pcolor
ax = gca()
File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 582, in gca
ax = gcf().gca(**kwargs)
File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 276, in gcf
return figure()
File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 254, in figure
**kwargs)
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 91, in new_figure_manager
canvas = FigureCanvasTkAgg(figure, master=window)
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 159, in __init__
self._tkcanvas.create_image(w/2, h/2, image=self._tkphoto)
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2159, in create_image
return self._create('image', args, kw)
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2150, in _create
*(args + self._options(cnf, kw))))
_tkinter.TclError: bad screen distance "320.0"
I didn't know that the import order was important. But I think there is something really messed up in the imports.
FYI I did test the code on another PC, same thing.
Do we have the same Python Version ? I have the 2.6.6-2ubuntu2 version.
I was able to make a minimalist test case for this bug :
import numpy numpy.array( [[1, 1],[1, 1]]))
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from matplotlib.pylab import pcolor
pcolor(
The segfault disappears if I put the 3 OpenGL imports after the matplotlib import !
BUT :
- If I add : from gtk.gtkgl.apputils import * at the top (before the other imports), the segfault reappears.
- If I add this line after the imports, I get a new type of error :
Traceback (most recent call last): numpy.array( [[1, 1],[1, 1]])) pymodules/ python2. 6/matplotlib/ pyplot. py", line 2077, in pcolor pymodules/ python2. 6/matplotlib/ pyplot. py", line 582, in gca pymodules/ python2. 6/matplotlib/ pyplot. py", line 276, in gcf pymodules/ python2. 6/matplotlib/ pyplot. py", line 254, in figure pymodules/ python2. 6/matplotlib/ backends/ backend_ tkagg.py" , line 91, in new_figure_manager gg(figure, master=window) pymodules/ python2. 6/matplotlib/ backends/ backend_ tkagg.py" , line 159, in __init__ _tkcanvas. create_ image(w/ 2, h/2, image=self. _tkphoto) python2. 6/lib-tk/ Tkinter. py", line 2159, in create_image 'image' , args, kw) python2. 6/lib-tk/ Tkinter. py", line 2150, in _create
File "test.py", line 12, in <module>
pcolor(
File "/usr/lib/
ax = gca()
File "/usr/lib/
ax = gcf().gca(**kwargs)
File "/usr/lib/
return figure()
File "/usr/lib/
**kwargs)
File "/usr/lib/
canvas = FigureCanvasTkA
File "/usr/lib/
self.
File "/usr/lib/
return self._create(
File "/usr/lib/
*(args + self._options(cnf, kw))))
_tkinter.TclError: bad screen distance "320.0"
I didn't know that the import order was important. But I think there is something really messed up in the imports.
FYI I did test the code on another PC, same thing.
Do we have the same Python Version ? I have the 2.6.6-2ubuntu2 version.