[PyQt] QOpenGLWidget missing module PyQt5._QOpenGLFunctions_2_1

Phil Thompson phil at riverbankcomputing.com
Wed Mar 11 22:45:05 GMT 2015


On 11/03/2015 9:30 pm, Peter Jensen wrote:
> Hi
> 
> I have a problem using the QOpenGLWidget.
> I get an import error concerning missing module: 
> PyQt5._QOpenGLFunctions_2_1
> Among many other things, I have tried forcing OpenGL 2.0 with
> QSurfaceFormat() and setVersion, but it doesn’t appear to make any
> difference.

If you mean that it still tries to import _QOpenGLFunctions_2_1 then you 
haven't managed to tell it to use OpenGL 2.0.

> Using Windows 8.1, Python 3.4.2(x32) and 
> PyQt5-5.4.1-gpl-Py3.4-Qt5.4.1-x32
> 
> Running the included example hellogl.py results in:
> File "C:/Python34/Lib/site-packages/PyQt5/examples/opengl/hellogl.py", 
> line
> 142, in initializeGL
>     self.gl = self.context().versionFunctions()
> ImportError: No module named 'PyQt5._QOpenGLFunctions_2_1'
> 
> Hellogl.py based on QGLWidget in PyQT 5.4.0 examples works.
> 
> Any help that would make QOpenGLWidget work, is very welcome.

I'm still discovering what's needed to make things work on all machines. 
I'll add the 2.1 module in the next installer.

Phil


More information about the PyQt mailing list