Qt.labs.qmlmodels is not installed

Phil Thompson phil at riverbankcomputing.com
Sun Feb 26 14:09:25 GMT 2023


On 08/02/2023 18:54, John Plummer wrote:
>     Looked for this in the archives back through Jan. 2022 with no
> success.  I am wanting to use the DelegateChooser/DelegateChoice
> components in a QML program.  In C++ (and PySide6) this requires
> 
> import Qt.labs.qmlmodels.
> 
>     Including that line results in the error shown in the subject 
> above.
> 
>     I am using Python 3.10 in Kubuntu 22.04 but I see the same error
> in Windows 11.  I found this suggestion online:
> 
> the pyqt6 folder doesn't have the Qt folder. So I copy that in pyside6
> lib to pyqt lib.
> 
> For me
> is:from|D:\Python\Python39\Lib\site-packages\PySide6\qml\Qt|to|D:\Python\Python39\Lib\site-packages\PyQt6\Qt6\qml|.
> 
>     When I copy the Qt directory, which only contains a labs
> subdirectory, the 'not installed' error becomes this error:
> 
> Cannot load library
> /home/jcp/pyqt6apps/SStarter/.venv/lib/python3.10/site-packages/PyQt6/Qt6/qml/Qt/labs/qmlmodels/liblabsmodelsplugin.so:
> (libQt6LabsQmlModels.so.6: cannot open shared object file: No such
> file or directory)
> 
> ( and a similar error in Windows).
> 
>     Is there a way to load the DelegateChooser/DelegateChoice
> components or will this have to wait until they are out of the labs
> environment?  Thanks in advance for any input.

I don't include experimental or preview versions of components. The 
suggestion above should work - you just need to copy the 
libQt6LabsQmlModels.so.6 file to the lib directory Qt6/lib directory as 
well.

Phil


More information about the PyQt mailing list