[PyQt] Include software rendering and HLSL compiler in the PyQt5 wheels for Windows

Cody Scott cody at perspexis.com
Tue Jun 5 19:12:21 BST 2018


I'm running a simple PyQt5 QML application[0] on a test Windows 7 32-bit VM
with only Python 3.6.5 and PyQt5==5.10.1 installed but I'm getting an error
about missing DLLs.

The full output is attached but the main part is

QWindowsEGLStaticContext::create: Could not initialize EGL display: error
0x3001
QWindowsEGLStaticContext::create: When using ANGLE, check if
d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions


When I build PyQt5 from source and add the Qt bin directory to my PATH
there are two additional files that are available.

d3dcompiler_47.dll and opengl32sw.dll

If they are not available the application fails with the same message I get
when PyQt5 was installed from PyPI using the wheel.

Should these two files be included in the PyQt5 wheels for Windows?

In the Qt Windows deployment docs[1] these two files are included in the
table of required files when using "dynamic OpenGL".

- d3dcompiler_XX.dll is the DirectX shader compiler[2], "where XX is the
version number that ANGLE (libGLESv2) was linked against."
- opengl32sw.dll is for software rendering

0: https://github.com/siecje/qml-testing
1:
http://doc.qt.io/qt-5/windows-deployment.html#creating-the-application-package
2: https://github.com/Microsoft/DirectXShaderCompiler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180605/283be247/attachment.html>
-------------- next part --------------
(venv) C:\Users\testvm\Downloads\qml-testing-master\qml-testing-master>python -m pip install PyQt5 --upgrade
Collecting PyQt5
  Using cached https://files.pythonhosted.org/packages/6c/63/89f888968ee0c7e7ffb2ea7604fae3ef85f7bc86f57dd07019805aa78798/PyQt5-5.10.1-5.10.1-cp35.cp36.cp37.cp38-none-win32.whl
Collecting sip<4.20,>=4.19.4 (from PyQt5)
  Using cached https://files.pythonhosted.org/packages/7a/49/67cc7955baf2ec5b67e141da2ab2a436cbf0f8d7c9fcab54e35df21d056b/sip-4.19.8-cp36-none-win32.whl
Installing collected packages: sip, PyQt5
Successfully installed PyQt5-5.10.1 sip-4.19.8

(venv) C:\Users\testvm\Downloads\qml-testing-master\qml-testing-master>python main.py
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001

QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001

QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001

QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
QWindowsEGLStaticContext::create: Could not initialize EGL display: error 0x3001

QWindowsEGLStaticContext::create: When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options Q
Flags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, gre
enBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, sam
ples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1
, colorSpace QSurfaceFormat::ColorSpace(DefaultColorSpace), profile  QSurfaceFor
mat::OpenGLContextProfile(NoProfile)) .
This is most likely caused by not having the necessary graphics drivers installed.

Install a driver providing OpenGL 2.0 or higher, or, if this is not possible, make sure the ANGLE Open GL ES 2.0 emulation libraries (libEGL.dll, libGLESv2.dll
and d3dcompiler_*.dll) are available in the application executable's directory or in a location listed in PATH.

(venv) C:\Users\testvm\Downloads\qml-testing-master\qml-testing-master>


More information about the PyQt mailing list