QML QtGraphicalEffects is not Installed
Asked Answered
L

2

2

I am trying to build any random QML component, and having this line import QtGraphicalEffects 1.15 will cause an error: 'module "QtGraphicalEffects" is not installed`

I am running on a virtual machine and just created a new virtual environment with Pyside6 and Python using pip install PySide6==6.1.2 to get the latest version. I can find the folder GraphicalEffects with a qtgraphicaleffectsplugin.dll in the Qt5Compat folder of the PySide6 Lib so I do not know why it cannot import this module. The other ones like QtQuick.Controls import fine.

I have also used print("Qt version: " + str(QtCore.qVersion())) to double check Qt version, and I get Qt version: 6.1.2

There seems to be some solutions in other discussion posts, but I have not found one that refers to Python side of things. I am aware Qt 6.0 does not seem to have QtGraphicalEffects, but it's supposed to be in 6.1. I am also not sure if this has to do with the virtual machine because on host I actually have no issue using QtGraphicalEffects

Linkage answered 7/7, 2021 at 20:59 Comment(0)
Y
4

Qt QtGraphicalEffects is available in PySide6 but the module has changed the way of importing to import Qt5Compat.GraphicalEffects as indicated in the docs.

Yarborough answered 8/7, 2021 at 2:7 Comment(0)
A
1

In Arch or other Linux distro, just install a package named "qt5-graphicaleffects" (Arch) or "qml-module-qtgraphicaleffects" (Ubuntu)

sudo pacman -Syu qt5-graphicaleffects

or

sudo apt update && sudo apt upgrade 
sudo apt install qml-module-qtgraphicaleffects

Hope this help.

Araujo answered 7/10, 2023 at 12:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.