Importing PyQt5* fails on Mac

Phil Thompson phil at riverbankcomputing.com
Tue Oct 31 10:40:55 GMT 2023


On 31/10/2023 08:05, ullix wrote:
> This one-liner fails on Mac (macbook air M1, OS Big Sur 11.6):
> 
>    fromPyQt5.QtWidgetsimport*
> 
> with this output on Py3.10 and same on Py3.11:
> 
>    python3.10 test4mac.py Exception:
>    
> dlopen(/opt/homebrew/lib/python3.10/site-packages/PyQt5/QtWidgets.abi3.so,
>    2): Symbol not found: __ZTVNSt3__13pmr25monotonic_buffer_resourceE
>    Referenced from:
> 
> /opt/homebrew/lib/python3.10/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore
>    Expected in: /usr/lib/libc++.1.dylib in
> 
> /opt/homebrew/lib/python3.10/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore
>    python3.11 test4mac.py Exception:
> 
> dlopen(/Users/alkaddy/Library/Python/3.11/lib/python/site-packages/PyQt5/QtWidgets.abi3.so,
>    2): Symbol not found: __ZTVNSt3__13pmr25monotonic_buffer_resourceE
>    Referenced from:
> 
> /Users/alkady/Library/Python/3.11/lib/python/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore
>    Expected in: /usr/lib/libc++.1.dylib in
> 
> /Users/alesandro/Library/Python/3.11/lib/python/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore
> 
> 
> The tiny test program is attached.
> The PyQt stuff had been installed with:
> 
>    |python3 -m pip uninstall PyQt5 PyQt5-sip|
> 
> Any guidance? Thanks.
> ullix

It's possibly an issue with your version of macOS. The Qt wheels are 
built with Xcode 15 on Ventura.

Phil


More information about the PyQt mailing list