qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
-
Thanks, now it works!
-
@Srinivas-Reddy I solved this issue, tks
-
Hey there,
it seems like I am facing the same issue as well, on Arch once again.
I have already tried debugging with QT_DEBUG_PLUGINS=1 (https://termbin.com/uszc - After fixage) but after solving all of the errors there I still wasn't able to fix this.
The applications run fine when executing them with sudo, but just not otherwise.
Do you have and Ideas?
Thanks! -
@UltraBlack_
Please search again for your error message, which isqt.qpa.xcb: could not connect to display
. There are plenty of posts about that on this forum and elsewhere. As I wrote earlier that means:Not an xcb library loading problem, rather however your X display is set up/connecting.
Since you say it runs under
sudo
, I can only imagine either your permissions or your X environment is set up to allow that but not for your non-sudo
user.As always, try to run an
xterm
. If you cannot run that you know you do not have a Qt problem. -
Same problem here.
When I run app freshly build everything works.
But when I want to >process.setArguments(["--set-rpath", "./", releaseFile])
Then everything breaks. Error :Warning: Ignoring WAYLAND_DISPLAY on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Its driving me nuts. Adding rpath relative to current binary/folder breaks everything ;/
-
@Dariusz said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
Adding rpath relative to current binary/folder
It is relative to current working directory - are you sure it is the correct one?
-
@jsulm said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
@Dariusz said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
Adding rpath relative to current binary/folder
It is relative to current working directory - are you sure it is the correct one?
Relative to the current working directory... but if I move exe to a different directory, then will the path be relative to that new directory or old one?
Its all in root of app, I even tried to copy plugins content out of plugins folder and in to root too. Nothing seems to be working. -
@Dariusz said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
but if I move exe to a different directory, then will the path be relative to that new directory or old one?
Well, yes it should be the working directory of the process you start, so the one where the exe is located.
-
@jsulm Yep, then should be relative. Looking at argument I pass process.setArguments(["--set-rpath", "./", releaseFile]) I set rpath to be ./ which is I take relative to exe dir.
He still fails to properly solve the xbc/wayland stuff. Do I need to dig in to xcb library themself, and remap them too to point to correct qt folders or something? I'll ldd them see what they look for where.
Maybe they need configuring too to be relative to xx project. -
Hi, the displayed message may indicate these two paths(
/home/lis/.local/lib/python3.9/site-packages/cv2/qt/plugins/platforms/libqxcb.so /home/lis/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so
) are mixed. How should I fix this? . Thanks!
QFactoryLoader::QFactoryLoader() looking at "/home/lis/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so" Found metadata in lib /home/lis/.local/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "xcb" ] }, "archreq": 0, "className": "QXcbIntegrationPlugin", "debug": false, "version": 331520 } Got keys from plugin meta data ("xcb") QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ... loaded library "/home/lis/.local/lib/python3.9/site-packages/cv2/qt/plugins/platforms/libqxcb.so" qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/lis/.local/lib/python3.9/site-packages/cv2/qt/plugins" even though it was found.
-
@HlaElks
I don't know which of thecv2
versus thePyQt5
ones you want/need to load. But if you want to find out why/home/lis/.local/lib/python3.9/site-packages/cv2/qt/plugins/platforms/libqxcb.so
failed to load you might runldd
on it and examine the output for a missing dependency. Whether that is what you need to know I don't know. -
Hi there. I've encountered the same type of issue when running Seagate's:
./run_SeaTools.sh qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/lib/x86_64-linux-gnu/qt5/plugins:/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" even though it was found.
I could not read all the posts in this thread, but I tried some of the proposed solutions which did not solve anything in my case:
# apt install --reinstall libqt5gui5 qtbase5-dev qt5dxcb-plugin libxcb-xinerama0 ... # export QT_DEBUG_PLUGINS=1 # export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms # ./run_SeaTools.sh qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/lib/x86_64-linux-gnu/qt5/plugins:/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" even though it was found. This application failed to start because no Qt platform plugin could be initialized. ...
Any suggestion?
-
@actionmystique
As has been said many times, the first thing to try is running with environment variableQT_DEBUG_PLUGINS=1
.
When you have located the xcb.so
file, you might also runldd
on it to see if that tells you anything is missing. -
Hi
@actionmystique why are you trying to run a GUI application as root ?
How did you become root in the first place ?
-
why are you trying to run a GUI application as root ?
root is required to run /usr/bin/env which is used in the script. I do no see any reason why being root may be the root ;-) cause for this issue.
How did you become root in the first place ?
Does it really matter?
-
@actionmystique said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
root is required to run /usr/bin/env
I do not know what platform/variant of Linux you are on, but since when has running
/usr/bin/env
ever required root permission/user to run??I do no see any reason why being root may be the root ;-) cause for this issue.
Xorg does not like a root user to run UI applications if you are logged into it as a non-root user. (I don't know whether
xhost +...
would permit this.) I imagine that is why @SGaist is asking. -
I do not know what platform/variant of Linux you are on, but since when has running /usr/bin/env ever required root permission/user to run??
I did not phrase it correctly; pkexec needs root to run env ; the script contains:
pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "$seadoctorDir"/exec-seatools-in-dir
-
@actionmystique
If you are running as root but not logged on as root I still wonder if that is the issue.Xorg
By default, and for security reasons, root will be unable to connect to a non-root user's X server. There are multiple ways of allowing root to do so however, if necessary.
https://wiki.archlinux.org/title/Running_GUI_applications_as_root
Maybe this is an issue, maybe it is not.
-
@JonB
I tried:- login as root: same result
- add one policy kit file for env and for SeaTools: same result
org.freedesktop.policykit.pkexec.policy
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> <policyconfig> <action id="org.freedesktop.policykit.pkexec.run-env"> <description>Run env</description> <message>Authentication is required to run env</message> <defaults> <allow_any>no</allow_any> <allow_inactive>no</allow_inactive> <allow_active>auth_admin_keep</allow_active> </defaults> <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/env</annotate> <annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate> </action> <action id="org.freedesktop.policykit.pkexec.run-SeaTools"> <description>Run SeaTools</description> <message>Authentication is required to run SeaTools</message> <defaults> <allow_any>no</allow_any> <allow_inactive>no</allow_inactive> <allow_active>auth_admin_keep</allow_active> </defaults> <annotate key="org.freedesktop.policykit.exec.path">/opt/SeaTools5/SeaTools</annotate> <annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate> </action> </policyconfig>
However, I did notice one file which may or may not be adequate: qt.conf
# Generated by linuxdeployqt # https://github.com/probonopd/linuxdeployqt/ [Paths] Prefix = ./ Plugins = plugins Imports = qml Qml2Imports = qml
-
Has anyone tried to run SeaTools from seagate on Ubuntu?