I have a python PySide6 program that I want to compile and test on a container. The program runs on Windows, so I have a Windows container:
FROM winamd64/python:3.13.5-windowsservercore
# .. install choco, git bash, vcredist2017, visualstudio2022buildtools, visualstudio2022-workload-vctools, python3 --version 3.13.7
Then I build (with setuptools) and run my program within the container.
Everything was fine until a colleague added an import:
from PySide6.QtWebEngineWidgets import QWebEngineView
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-> ImportError: DLL load failed while importing QtWebEngineWidgets: The specified module could not be found
The import works fine on our Windows 11 machines, but not on the docker container.
What I tried:
- I compared with Meld my
.venv/313/Lib/site-packages/PySide6andshiboken6on my machine and on the container, they are identical. - I tried to use
dlltracer, which showed me that 7 packages "Loaded" but absent from "Failed" (MSVCP140.dll, Shiboken.pyd, VCRUNTIME140_1.dll, _bz2.pyd, _lzma.pyd, kernel.appcore.dll, shiboken6.abi3.dll), but they are all in the container EXPORT_QTA_PLAFORM=offscreenhelped me for the unit tests that could not start, but not helpful here- I tried to use
FROM mcr.microsoft.com/windows:20H2, but without success
Can my docker container import QtWebEngineWidgets, or is not designed for such imports? Are there any compatibility issues between pyd/dll files and the docker container system? How to debug this?
Thank you very much for any help!
PyQtorPySideinstallsQtwith all needed.dll- if not then it may need to installQt(not withpipbut with something like this). ButQtWebEngineWidgetsmay also need other libraries .dll which normally can be installed on system but they are not available in dockers. So I only guess what can be the problem :)