0

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/PySide6 and shiboken6 on 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=offscreen helped 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!

5
  • Python module PyQt is a wrapper on C/C++ framework Qt. And it may need to install Qt. Commented Sep 25 at 15:39
  • python 3.x - Use PyQt5.QtWebEngineWidgets on Windows: is it possible? - Stack Overflow Commented Sep 25 at 15:41
  • @furas the OP is having issues with a docker container, not a common deployment (standalone executable, folder distribution or install procedure); they also mention that, until the QtWebEngineWidgets addition to the imports, everything was working fine. I don't have any experience with docker, yet I believe that the pip approach won't be valid for this (or, at least, it shouldn't be the first choice, as the docker should be self-contained). They also use PySide, not PyQt. Commented Sep 25 at 19:26
  • @musicamante I don't have experience with dockers with Windows but as I know it blocks access to external libraries and it may need to install all libraries directly in docker. I don't know if PyQt or PySide installs Qt with all needed .dll - if not then it may need to install Qt (not with pip but with something like this). But QtWebEngineWidgets may 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 :) Commented Sep 25 at 22:37
  • 2
    @furas Yes, both PyQt and PySide include their relative Qt binaries when installed through standard pip, and can be installed for the local user (this is also valid for QtWebEngine). Docker is another story, though, mostly because the need for actual libraries complicates things. The OP has filed a report (PYSIDE-3194), and in comments they indeed confirm that they don't generally support docker containers exactly due to issues with missing libraries. Commented Sep 26 at 10:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.