Qt platform plugin could be initialized linux

Решенные How start compiler in Ubuntu 20

Hi!
How start compiler in Ubuntu 20.
I install «xcb» and and some other packages, but I get this error:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb. 

Hi
What Qt version ?
And how did you install it ? This i just experinced in older linux mint upgrading to Qt5.15

I use Qt 5.15, I use online installer.
When installing on Windows, files did not arrive due to poor server speed and they had to be reinstalled. Maybe with Linux the same trouble.

Hi, Set QT_DEBUG_PLUGINS environment variable to 1 and restart your application. You shall have more information about why it fails to load.

@Mikeeeeee
Hi
You must do that in a shell.
Not in the .pro file So open a shell
type
export QT_DEBUG_PLUGINS = 1
and then start creator in this shell. If you dont know where creator is, you can right click its icon and edit it and see path there.

JonB

  1. Open a console/terminal.
  2. Type: export QT_DEBUG_PLUGINS=1
  3. Type the path to the Qt Creator executable to run it.

Because it has been run from a shell with that environment variable exported, you will get debug output showing you where it’s looking for what, to diagnose your problem.

export QT_DEBUG_PLUGINS = 1 
bash: export: «=»: this is an invalid identifier bash: export: «1»: this is an invalid identifier 

JonB

@Mikeeeeee said in How start compiler in Ubuntu 20:
I just copied what @mrjj typed. Correct is to remove the spaces:

Читайте также:  Linux check system disk

I write this in folder «Qt», but qt did not issue any new errors. Still, maybe this is because the installer might not have downloaded the files?

JonB

@Mikeeeeee
Prior to the qt.qpa.plugin: Could not load . error message, because of the environment variable you should have output (in the terminal) on where it looked for plugin xcb but failed to find it.

/home/admin1/Qt/5.15.0/gcc_64/bin/uic ../test/mainwindow.ui -o ui_mainwindow.h g++ -c -pipe -g -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../test -I. -I../../Qt/5.15.0/gcc_64/include -I../../Qt/5.15.0/gcc_64/include/QtWidgets -I../../Qt/5.15.0/gcc_64/include/QtGui -I../../Qt/5.15.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I../../Qt/5.15.0/gcc_64/mkspecs/linux-g++ -o main.o ../test/main.cpp g++ -pipe -g -std=gnu++11 -Wall -Wextra -dM -E -o moc_predefs.h ../../Qt/5.15.0/gcc_64/mkspecs/features/data/dummy.cpp g++ -c -pipe -g -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../test -I. -I../../Qt/5.15.0/gcc_64/include -I../../Qt/5.15.0/gcc_64/include/QtWidgets -I../../Qt/5.15.0/gcc_64/include/QtGui -I../../Qt/5.15.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I../../Qt/5.15.0/gcc_64/mkspecs/linux-g++ -o mainwindow.o ../test/mainwindow.cpp /home/admin1/Qt/5.15.0/gcc_64/bin/moc -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /home/admin1/QtProjects/build-test-Desktop_Qt_5_15_0_GCC_64bit-Debug/moc_predefs.h -I/home/admin1/Qt/5.15.0/gcc_64/mkspecs/linux-g++ -I/home/admin1/QtProjects/test -I/home/admin1/Qt/5.15.0/gcc_64/include -I/home/admin1/Qt/5.15.0/gcc_64/include/QtWidgets -I/home/admin1/Qt/5.15.0/gcc_64/include/QtGui -I/home/admin1/Qt/5.15.0/gcc_64/include/QtCore -I. -I/usr/include/c++/9 -I/usr/include/x86_64-linux-gnu/c++/9 -I/usr/include/c++/9/backward -I/usr/lib/gcc/x86_64-linux-gnu/9/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include ../test/mainwindow.h -o moc_mainwindow.cpp g++ -c -pipe -g -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../test -I. -I../../Qt/5.15.0/gcc_64/include -I../../Qt/5.15.0/gcc_64/include/QtWidgets -I../../Qt/5.15.0/gcc_64/include/QtGui -I../../Qt/5.15.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I../../Qt/5.15.0/gcc_64/mkspecs/linux-g++ -o moc_mainwindow.o moc_mainwindow.cpp g++ -Wl,-rpath,/home/admin1/Qt/5.15.0/gcc_64/lib -o test main.o mainwindow.o moc_mainwindow.o /home/admin1/Qt/5.15.0/gcc_64/lib/libQt5Widgets.so /home/admin1/Qt/5.15.0/gcc_64/lib/libQt5Gui.so /home/admin1/Qt/5.15.0/gcc_64/lib/libQt5Core.so -lGL -lpthread 

JonB

@Mikeeeeee
I don’t understand. Your output now shows a compilation. I thought your problem as reported by you was when you tried to start an application:

qt.qpa.plugin: Could not load the Qt platform plugin «xcb» in «» even though it was found.
This application failed to start .

Источник

Attempting to use the QtWidgets in venv gives error «no Qt platform plugin could be initialized»

I’m using PyQt5 for the first time, and my instructor has given me some basic code to run. We’re using an Ubuntu bash shell on Windows 10 in a virtual environment. However, it says that the plugin could not be initialized. I’ve tried reinstalling Qt with

 export QT_DEBUG_PLUGINS = 1 
 sudo apt install lbqt5x11extras-dev sudo apt-get install libxkbcommon-x11-dev 
import sys from PyQt5.QtWidgets import QApplication, QWidget, QLabel my_qt_app = QApplication(sys.argv) 
Got keys from plugin meta data ("xcb") loaded library "/mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so" qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb. 
linux-vdso.so.1 (0x00007fffc4d21000) libQt5XcbQpa.so.5 => /mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5 (0x00007fa7fbc50000) libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fa7fba00000) libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fa7fb740000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa7fb520000) libQt5Gui.so.5 => /mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libQt5Gui.so.5 (0x00007fa7facd0000) libQt5DBus.so.5 => /mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libQt5DBus.so.5 (0x00007fa7faa30000) libQt5Core.so.5 => /mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libQt5Core.so.5 (0x00007fa7fa280000) libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fa7f9ff0000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa7f9dd0000) libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fa7f9bc0000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa7f9990000) libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fa7f9770000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fa7f9550000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa7f9210000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa7f8e70000) libxkbcommon-x11.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 (0x00007fa7f8c60000) libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fa7f8a20000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa7f8800000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa7f8470000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa7f8250000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa7f7e50000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fa7f7c40000) libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fa7f7920000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fa7f76d0000) libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fa7f7490000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fa7f7240000) libicui18n.so.56 => /mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libicui18n.so.56 (0x00007fa7f6da0000) libicuuc.so.56 => /mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libicuuc.so.56 (0x00007fa7f69e0000) libicudata.so.56 => /mnt/c/Users/cture/Desktop/envs/cst205env/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libicudata.so.56 (0x00007fa7f4fe0000) /lib64/ld-linux-x86-64.so.2 (0x00007fa7fc400000) libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fa7f4da0000) libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fa7f4ae0000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa7f48d0000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa7f46c0000) libxcb-xkb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007fa7f4490000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fa7f4210000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fa7f3f80000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fa7f3d60000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa7f3b50000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fa7f3910000) liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fa7f36f0000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fa7f33d0000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fa7f31b0000)``` 

Источник

Читайте также:  Программное обеспечение компьютера linux

pyqt5: This application failed to start because no Qt platform plugin could be initialized — installation problem?

but it seems like there is no Qt folder in pyqt5_tools on my computer. I have removed and installed back pyqt5, pyqt5-tools, pyqt5-plugins several times but it does not work. Can it be connected to the fact that I am using a subsystem? (I have downloaded pyqt5 both on Windows and on Ubuntu). Any suggestions to solve this problem?

5 Answers 5

Someone suggested to run «xhost +local:» first.

The error relates to a missing requirement for one or multiple XCB-related libraries, which needs to be fulfilled on X11 for Qt to function properly. For a full list of XCB libraries check here.

I would suggest that, instead of copying files left and right, you first try reinstalling PyQt5 via pip . I’ve had a similar experience with conda , where PySided2 was not working due to a missing shiboken , which I had to install via pip .

In addition you may want to try conda (e.g. Anaconda or Miniconda). Last but not least, if this is the only problem you have, you may attempt to install the required XCB libraries. This is however tricky, since the version your distro provides may be different from the rest that the pip installation has.

A safe way for installing PyQt5 is simply using the package manager of your distro inside WSL. Since it’s a virtualized system I’d assume that it’s created solely for the purpose of working on a PyQt5 project and after that it will be deleted. Tainting the clean initial setup should therefor not be an issue.

Читайте также:  Циклы командная строка linux

Источник

Оцените статью
Adblock
detector