PyQt5 qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in ““ even though it was found.

Problem:

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.

Aborted (core dumped)

Solution:

sudo apt-get install libxcb-xinerama0


When using visdom for visualization, I encountered the following error:

 
  1. Setting up a new session...

  2. [Errno 111] Connection refused

  3. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

  4. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

  5.  
  6. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

I turned to search engines and found that there are many people asking this question on the Internet.

First used 

export QT_DEBUG_PLUGINS=1

Then re-run the program and see that it is

 
  1. Got keys from plugin meta data ("xcb")

  2. QFactoryLoader::QFactoryLoader() looking at "/usr/local/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libxcb-xinerama.so.0"

  3. "Failed to extract plugin meta data from '/usr/local/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libxcb-xinerama.so.0'"

  4. not a plugin

  5. QFactoryLoader::QFactoryLoader() looking at "/usr/local/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libxcb-xinerama.so.0.0.0"

  6. "Failed to extract plugin meta data from '/usr/local/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libxcb-xinerama.so.0.0.0'"

  7. not a plugin

  8. QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/bin/platforms" ...

  9. Cannot load library /usr/local/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: 无法打开共享对象文件: 没有那个文件或目录)

  10. QLibraryPrivate::loadPlugin failed on "/usr/local/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /usr/local/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so

  11. .0: 无法打开共享对象文件: 没有那个文件或目录)"

  12. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

  13. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

  14.  
  15. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

 Tried various methods, several of which did not work, the final solution:

 apt-get install libxcb-xinerama0

 Note that there is a number 0 at the end

Guess you like

Origin blog.csdn.net/u012308586/article/details/108509503