Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load the Qt platform plugin "xcb" (Ubuntu 20.04.02) #518

Closed
matejkarasek opened this issue Jun 22, 2021 · 9 comments
Closed

Could not load the Qt platform plugin "xcb" (Ubuntu 20.04.02) #518

matejkarasek opened this issue Jun 22, 2021 · 9 comments
Milestone

Comments

@matejkarasek
Copy link

When launching cfclient I get the following error:

...
INFO:cfclient.utils.zmq_param:ZMQ param disabled in config file
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)

Starting from a clean installation of Ubuntu 20.04.02, I followed the latest installation instructions:

sudo apt install git python3-pip
pip3 install --upgrade pip

I set the udev rules and cloned the repo

I get the above error when installing from source (pip install -e .) as well as when installing from release (pip install cfclient).

If I install via Ubuntu Software everything works fine (but cannot modify the source then...).

@knmcguire
Copy link
Contributor

Hi!

On my ubuntu 20.04 wsl I'm able to recreate the problem. By adding export QT_DEBUG_PLUGINS=1 to .bashrc it is possible to seem more debug messages, then I get the following:

Cannot load library /home/kimberly/.local/lib/python3.8/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/kimberly/.local/lib/python3.8/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so" : "Cannot load library /home/kimberly/.local/lib/python3.8/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)"
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

Seems that libxcb-icccm.so is the curlprit here... and it seems to be connected to the opencv headless pip library. Perhaps there is some mismatching going on?

@knmcguire
Copy link
Contributor

you can check it too with the same flag to see if you get the same error message

@matejkarasek
Copy link
Author

Yes, with the debug on, I do get the exact same error message

@matejkarasek
Copy link
Author

matejkarasek commented Jun 22, 2021

Following this post and launching
ldd -v /home/matej/.local/lib/python3.8/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so
the problem seems to be missing ''libxcb-xinerama0''

Probably not the best solution, but installing pyqt5 using apt-get seems to fix the issue:
sudo apt-get install python3-pyqt5

@knmcguire
Copy link
Contributor

ah good you found a temp solution there.

Indeed we need to find what is the curlpit. The pip install of the qt5 seems to have less things installed with than with the sudo-apt, so perhaps there is another python package that we are missing.

@knmcguire
Copy link
Contributor

So I did a grep with the library (libqxcb.so), which shows which libraries it is missing

 ldd /home/kimberly/.local/lib/python3.8/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so | grep "not found"
        libxcb-icccm.so.4 => not found
        libxcb-image.so.0 => not found
        libxcb-shm.so.0 => not found
        libxcb-util.so.1 => not found
        libxcb-keysyms.so.1 => not found
        libxcb-render-util.so.0 => not found
        libxcb-render.so.0 => not found
        libxcb-xinerama.so.0 => not found

Unfortunately I'm not really able to find a python package wrapper for these which would be the best. It might be annoying to install the apt-get package as the setup.py does not really take that into account.

@knmcguire
Copy link
Contributor

I've now added additional comments to the install instructions in PR #519. It's only a temp solution though until we can find a nice python wrapper for this.

ataffanel added a commit that referenced this issue Jul 14, 2021
A newly installed Ubuntu 20+ requires libxcb-xinemara0 to be installed manually in order for Qt to work.

This commits update the install instructions.
knmcguire added a commit that referenced this issue Jul 14, 2021
#518: Add libxcb-xinemara0 install req
@ataffanel
Copy link
Member

ataffanel commented Jul 15, 2021

In PR #523 I updated the readme with the minimum package required and added a message in the console when the client starts to indicate what package needs to be installed. I think this is the best we can do so I am closing this ticket, feel free to re-open or open a new one if you have a better idea on how to solve the problem.

@ataffanel ataffanel added this to the next-release milestone Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants