QAxWidget not working on PyQt6

Lukas Lang lukaslang.bugtracker at outlook.com
Mon Oct 6 13:21:00 BST 2025


(sending the message a second time because I got a "delivery failed" error the first time)

Thanks for the prompt response. Unfortunately, I get the same error even after installing PyQt6 with "pip install pyqt6==6.9.0". (pyqt6==6.8.1 works, but seems like a needlessly old version)

Best,
Lukas

-----Original Message-----
From: Phil Thompson <phil at riverbankcomputing.com> 
Sent: Monday, 6. October, 2025 12:08
To: Lukas Lang <lukaslang.bugtracker at outlook.com>
Cc: pyqt at riverbankcomputing.com
Subject: Re: QAxWidget not working on PyQt6

On 06/10/2025 07:44, Lukas Lang wrote:
> Hi,
> 
> I am running into an issue trying to use QAxWidget in PyQt6:
> 
> import sys
> from PyQt6.QAxContainer import QAxWidget from PyQt6.QtWidgets import 
> QApplication, QMainWindow
> 
> class MyWindow(QMainWindow):
>     def __init__(self):
>         super().__init__()
> 
>         self.ax = QAxWidget("Shell.Explorer.2") # other ActiveX 
> controls are also broken
> 
> if __name__ == "__main__":
>     app = QApplication(sys.argv)
>     window = MyWindow()
>     window.show()
>     sys.exit(app.exec())
> 
> Trying to run this in Python 3.13.7 with only PyQt6 installed, I get 
> "Cannot mix incompatible Qt library (6.9.0) with this library 
> (6.9.2)". Replacing PyQt6 in the imports with PyQt5 works as expected 
> on the other hand (after installing PyQt5 of course). Am I doing 
> something wrong, or is there a problem with the pre-built binaries?

QAxWidget does not guarantee backwards binary compatibility between Qt releases. These days I always build the wheels against the corresponding
.0 version of Qt. Hopefully if you pin the version of PyQt6-Qt6 to
v6.9.0 it should work.

Phil


More information about the PyQt mailing list