Hello,

I am trying to figure out what seems to be a recurring error:
PyQtGraph works fine in 2D but I do have a fez errors when trying the 
script "test3D.py"  enclosed in this message .

When executing the script ( test3D.py), the output displayed on the console 
is the following:

*<module 'OpenGL' from 'C:\Python27\lib\site-packages\OpenGL\__init__.pyc'> 
3.1.0*









































































*[16:02:39]      |==============================>>    |  Traceback (most 
recent call last):    |    File 
"C:\Users\mathieu.bisquay\Documents\scripts\tests\pyqtgraph\test3D.py", 
line 30, in <module>    |      pg.QtGui.QApplication.exec_()    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 179, 
in paintGL    |      self.drawItemTree(useItemNames=useItemNames)    |    
File "C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 
219, in drawItemTree    |      self.drawItemTree(i, 
useItemNames=useItemNames)    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 200, 
in drawItemTree    |      debug.printExc()    |    --- exception caught 
here ---    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 197, 
in drawItemTree    |      i.paint()    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\items\GLMeshItem.py", line 
170, in paint    |      with self.shader():    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\shaders.py", line 317, in 
__enter__    |      if len(self.shaders) > 0 and self.program() != -1:    
|    File "C:\Python27\lib\site-packages\pyqtgraph\opengl\shaders.py", line 
309, in program    |      compiled = [s.shader() for s in self.shaders]  ## 
compile all shaders    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\shaders.py", line 227, in 
shader    |      raise Exception("This OpenGL implementation does not 
support shader programs; many OpenGL features in pyqtgraph will not 
work.")    |  Exception: This OpenGL implementation does not support shader 
programs; many OpenGL features in pyqtgraph will not work.    
|==============================<<Error while drawing item 
<pyqtgraph.opengl.items.GLSurfacePlotItem.GLSurfacePlotItem object at 
0x05D9E2B0>. The original exception is printed above; however, pyqtgraph 
requires OpenGL version 2.0 or greater for many of its 3D features and your 
OpenGL version is 1.1.0. Installing updated display drivers may resolve 
this issue.[16:02:39]      |==============================>>    |  
Traceback (most recent call last):    |    File 
"C:\Users\mathieu.bisquay\Documents\scripts\tests\pyqtgraph\test3D.py", 
line 30, in <module>    |      pg.QtGui.QApplication.exec_()    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 179, 
in paintGL    |      self.drawItemTree(useItemNames=useItemNames)    |    
File "C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 
219, in drawItemTree    |      self.drawItemTree(i, 
useItemNames=useItemNames)    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 200, 
in drawItemTree    |      debug.printExc()    |    --- exception caught 
here ---    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 197, 
in drawItemTree    |      i.paint()    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\items\GLMeshItem.py", line 
204, in paint    |      glDisableClientState(GL_COLOR_ARRAY)    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\shaders.py", line 363, in 
__exit__    |      glUseProgram(0)    |    File 
"C:\Python27\lib\site-packages\OpenGL\platform\baseplatform.py", line 407, 
in __call__    |      self.__name__, self.__name__,    |  
NullFunctionError: Attempt to call an undefined function glUseProgram, 
check for bool(glUseProgram) before calling    
|==============================<<Error while drawing item 
<pyqtgraph.opengl.items.GLSurfacePlotItem.GLSurfacePlotItem object at 
0x05D9E2B0>. The original exception is printed above; however, pyqtgraph 
requires OpenGL version 2.0 or greater for many of its 3D features and your 
OpenGL version is 1.1.0. Installing updated display drivers may resolve 
this issue.[16:02:41]      |==============================>>    |  
Traceback (most recent call last):    |    File 
"C:\Users\mathieu.bisquay\Documents\scripts\tests\pyqtgraph\test3D.py", 
line 30, in <module>    |      pg.QtGui.QApplication.exec_()    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 179, 
in paintGL    |      self.drawItemTree(useItemNames=useItemNames)    |    
File "C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 
219, in drawItemTree    |      self.drawItemTree(i, 
useItemNames=useItemNames)    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 200, 
in drawItemTree    |      debug.printExc()    |    --- exception caught 
here ---    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\GLViewWidget.py", line 197, 
in drawItemTree    |      i.paint()    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\items\GLMeshItem.py", line 
204, in paint    |      glDisableClientState(GL_COLOR_ARRAY)    |    File 
"C:\Python27\lib\site-packages\pyqtgraph\opengl\shaders.py", line 363, in 
__exit__    |      glUseProgram(0)    |    File 
"C:\Python27\lib\site-packages\OpenGL\platform\baseplatform.py", line 407, 
in __call__    |      self.__name__, self.__name__,    |  
NullFunctionError: Attempt to call an undefined function glUseProgram, 
check for bool(glUseProgram) before calling    
|==============================<<Error while drawing item 
<pyqtgraph.opengl.items.GLSurfacePlotItem.GLSurfacePlotItem object at 
0x05D9E2B0>. The original exception is printed above; however, pyqtgraph 
requires OpenGL version 2.0 or greater for many of its 3D features and your 
OpenGL version is 1.1.0. Installing updated display drivers may resolve 
this issue.*


Also I updated pyopengl to 3.1.0 as it can be seen at the beginning of the 
error message ( highlighted in blue).
However the version 1.1.0 is also found (in orange there above).

Drivers on my computer were updated a couple of months ago (january 2017).
I used the windows installer of pyqtgraph V0.10.0 ...

Question is: How could that issue be solved?

Many thanks

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/252636aa-13e8-4926-9d5a-408d055aed98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import pyqtgraph as pg
import pyqtgraph.opengl as gl

#print 'Verification : ',gl.__version__
import OpenGL
print OpenGL, OpenGL.__version__


### something to graph ######
from numpy import *
pi=3.1415
X=linspace(-10,10,100)
Y1=2+sin(X)
Y2=-2+Y1*Y1
Y3=cos(1*Y1)/(X+0.0131415)
Y4=4+sin(X)*cos(2*X)
Z=exp(-0.1*X*X)*cos(0.3*(X.reshape(100,1)**2+X.reshape(1,100)**2))
#############################
# you need this call ONCE 
app=pg.QtGui.QApplication([])
#############################

##### plot 3D surface data  ####
w = gl.GLViewWidget()
## Saddle example with x and y specified
p = gl.GLSurfacePlotItem(x=X, y=X, z=Z, shader='heightColor')
w.addItem(p)
# show
w.show()
pg.QtGui.QApplication.exec_()

#==============================================

##### plot 3D line data  ####
w = gl.GLViewWidget()
# first line
Z=zeros(size(X))
p=array([X,Y2,Z])
p=p.transpose() 
C=pg.glColor('w')
###### SCATTER ######
plt = gl.GLScatterPlotItem(pos=p, color=C)
w.addItem(plt)
# second line
Z=zeros(size(X))
p=array([X,Z,Y3])
p=p.transpose() 
C=pg.glColor('b')
######## LINE  ############
plt = gl.GLLinePlotItem(pos=p, connected=False,width=20.5,color=C)
w.addItem(plt)
# third line
Z=zeros(size(X))
p=array([Z,Y1,X])
p=p.transpose() 
C=pg.glColor('g')
########### SCATTER #############
plt = gl.GLScatterPlotItem(pos=p, color=C, size=20)
w.addItem(plt)
############# GRID #################
g=gl.GLGridItem()
w.addItem(g)
# show
w.show()
pg.QtGui.QApplication.exec_()

Reply via email to