QtQuick.VectorImage in PySide6
-
I have a VectorImage component defined in an external file like this:
import QtQuick.VectorImage VectorImage { id: background anchors.fill: parent preferredRendererType: VectorImage.GeometryRenderer source: "./images/logo.svg" }This works great in PySide6 6.9.3, but when I upgrade 6.10.0 I get the following error:
QQmlApplicationEngine failed to load component file://<path-to-project>/ui/MainWindow.qml:27:5: Type Logo unavailable file://<path-to-project>/ui/common/Logo.qml:1:1: module "QtQuick.VectorImage" version 6.10 cannot be imported because: Cannot load library <path-to-project>/venv/lib/python3.13/site-packages/PySide6/Qt/qml/QtQuick/VectorImage/Helpers/libqquickvectorimagehelpersplugin.dylib: dlopen(<path-to-project>/venv/lib/python3.13... ...'/opt/homebrew/lib/QtQuickVectorImageHelpers.framework/Versions/A/QtQuickVectorImageHelpers' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/QtQuickVectorImageHelpers.framework/Versions/A/QtQuickVectorImageHelpers' (no such file)All I did to install 6.10.0 was call
pip install --upgrade pyside6.Anyone else having issues with the VectorImage component in 6.10.0 or know how to resolve the error?
-
Hi and welcome to devnet,
This looks like it could be a packaging issue. Can you provide a minimal project that triggers this ?
-
This should work. I had to upload it to Google Drive since I don't have permissions to upload a file here.
https://drive.google.com/file/d/1ffka0igRea74Z_zluI-DiEPfFP5lEjcL/view?usp=drive_link
I verified this displays an ApplicationWindow with a VectorImage on a white background in 6.9.3. This fails to load in 6.10.0.
-
I also came across this using QtCreator. I was able to get a file with the corresponding
VectorImageimport to load, and a single test with a random svg logo seemed to work.I'm currently running Fedora 41.
First, to trigger this error:
- File: New Project
- Application (Qt for Python) >
Qt Quick Application - Empty - PySide version:
PySide 6 - For kit selection, I'm assuming the version of Qt doesn't actually matter for the purposes of running the python project because PySide6 comes with its own copy of the Qt libraries (or at least I assume). The python version is v3.13.7
- Application (Qt for Python) >
- Edit
main.qml(all I added was the VectorImage import statement)import QtQuick import QtQuick.Window import QtQuick.VectorImage Window { width: 640 height: 480 visible: true title: qsTr("Hello World") }
That results in the following terminal output:
19:33:13: Starting /home/tony/cloud/projects/qt-creator/TestVectorImage2/.qtcreator/Python_3_13_7venv/bin/python -u main.py... QQmlApplicationEngine failed to load component file:///home/tony/cloud/projects/qt-creator/TestVectorImage2/main.qml:3:1: module "QtQuick.VectorImage" version 6.10 cannot be imported because: Cannot load library /home/tony/cloud/projects/qt-creator/TestVectorImage2/.qtcreator/Python_3_13_7venv/lib/python3.13/site-packages/PySide6/Qt/qml/QtQuick/VectorImage/Helpers/libqquickvectorimagehelpersplugin.so: libQt6QuickVectorImageHelpers.so.6: cannot open shared object file: No such file or directory 19:33:13: The command "/home/tony/cloud/projects/qt-creator/TestVectorImage2/.qtcreator/Python_3_13_7venv/bin/python -u main.py" terminated with exit code 255.
To fix the issue...
Since I have a few versions of Qt installed, I searched them for the desired file -libQt6QuickVectorImageHelpers.so.6. The only version I have is fromv6.10.0, so I assume it is new to this version of Qt. The file's exact location:~/Qt/6.10.0/gcc_64/lib/libQt6QuickVectorImageHelpers.so.6 //and that was just a link to... ~/Qt/6.10.0/gcc_64/lib/libQt6QuickVectorImageHelpers.so.6.10.0I then searched the python venv - specifically PySide6's
Qtdir - forlibQt6and found the directory PySide6 uses for similarly named libraries is....../site-packages/PySide6/Qt/lib/So, in my case, copying:
~/Qt/6.10.0/gcc_64/lib/libQt6QuickVectorImageHelpers.so.6.10.0to....(note the change in file extension)
.../site-packages/PySide6/Qt/lib/libQt6QuickVectorImageHelpers.so.6...seems to have fixed it.
Hopefully this helps
- File: New Project
-
@fossilx so it seems that's indeed a packaging issue.
For the file name, usually you have a set of symbolic links that points to the fully specified library:libQt6QuickVectorImageHelpers.so.6 -> symlink to libQt6QuickVectorImageHelpers.so.6.10.0 libQt6QuickVectorImageHelpers.so.6.10 -> symlink to libQt6QuickVectorImageHelpers.so.6.10.0 libQt6QuickVectorImageHelpers.so.6.10.0This allows you to have fined grained control on how you want to link to that library.
-
I built Qt from source on my Mac since the latest Qt online installer only installs 6.9.3. I found the dylib file after I built from source and copied it to where it was expected. I was able to start my app.
Is there anything I need to do to raise awareness of this issue so it's fixed in the packing the release next time?
-
I built Qt from source on my Mac since the latest Qt online installer only installs 6.9.3. I found the dylib file after I built from source and copied it to where it was expected. I was able to start my app.
Is there anything I need to do to raise awareness of this issue so it's fixed in the packing the release next time?
@usymbiote you can check the bug report system. If there's nothing related yet, please open a new ticket.