Error using pyOpenGl, 'module' object has no attribute 'TextureBufferUniform'

Hi, I just learn to use OpenGl on c++ but now I’d like to use it on python but when I run the code from this tutorial Introduction to Shaders: First steps (Basic Geometry)

I get the following error

Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 314, in 'calling callback function'
  File "/Library/Python/2.7/site-packages/OpenGLContext/glutcontext.py", line 136, in OnRedisplay
    self.triggerRedraw(1)
  File "/Library/Python/2.7/site-packages/OpenGLContext/context.py", line 610, in triggerRedraw
    self.OnDraw()
  File "/Library/Python/2.7/site-packages/OpenGLContext/context.py", line 515, in OnDraw
    visibleChange = self.renderPasses( self )
  File "/Library/Python/2.7/site-packages/OpenGLContext/passes/renderpass.py", line 862, in __call__
    from OpenGLContext.passes.flatcompat import FlatPass
  File "/Library/Python/2.7/site-packages/OpenGLContext/passes/flatcompat.py", line 2, in <module>
    from . import _flat
  File "/Library/Python/2.7/site-packages/OpenGLContext/passes/_flat.py", line 10, in <module>
    from OpenGLContext.scenegraph import shaders
  File "/Library/Python/2.7/site-packages/OpenGLContext/scenegraph/shaders.py", line 228, in <module>
    class TextureBufferUniform( _TextureUniform, shaders.TextureBufferUniform ):
AttributeError: 'module' object has no attribute 'TextureBufferUniform'

and I go to the file with the error and in fact there is an error

from vrml.vrml97 import shaders
...
class TextureBufferUniform( _TextureUniform, shaders.TextureBufferUniform ):
...

and in vrml.vrml97 there is no definition of TextureBufferUniform.
Maybe I installed a wrong version or something.

That seems likely. This version has a TextureBufferUniform definition in vrml97/shaders.py.

If you’re already familiar with using OpenGL from C++, I’d suggest ignoring OpenGLContext and just using PyOpenGL directly (PyOpenGL includes bindings for GLUT).

[QUOTE=GClements;1291378]That seems likely. This version has a TextureBufferUniform definition in vrml97/shaders.py.

[/QUOTE]

Thanks! I going to try with that, (it weird because I download the file using pip).

That’s option B, I’m kind of lazy XD.

[QUOTE=GClements;1291378]That seems likely. This version has a TextureBufferUniform definition in vrml97/shaders.py.

If you’re already familiar with using OpenGL from C++, I’d suggest ignoring OpenGLContext and just using PyOpenGL directly (PyOpenGL includes bindings for GLUT).[/QUOTE]

Yea!!! it was that, I finally install it. The tutorial has a link for the download but downloads the previous version, I uninstall and download again from pip.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.