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

Failed to run GALog on Ubuntu 22.04 #1

Closed
poul1x opened this issue Jan 9, 2024 · 1 comment
Closed

Failed to run GALog on Ubuntu 22.04 #1

poul1x opened this issue Jan 9, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@poul1x
Copy link
Owner

poul1x commented Jan 9, 2024

I've encountered an error while running the GALog on Ubuntu 22.04:

(venv) user@user-virtual-machine:~/Documents/galog$ python3 -m galog
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)

All installation steps before running this command were successful.

OS: Linux Ubuntu 22.04
Python version: 3.10

@poul1x poul1x added the help wanted Extra attention is needed label Jan 9, 2024
@poul1x
Copy link
Owner Author

poul1x commented Jan 9, 2024

I found a thread discussing this bug. In short, the error is likely due to some required libraries being missing.

Installing the following packages should resolve the issue:

sudo apt install \
    libxcb-icccm4 \
    libxcb-image0 \
    libxcb-keysyms1 \
    libxcb-render-util0 \
    libxcb-xinerama0 \
    libxcb-xkb1 \
    libxkbcommon-x11-0

Since library versions may vary across different Ubuntu releases, I've prepared a more flexible version of the solution that can adapt to different scenarios:

sudo apt install \
    '^libxcb-icccm[0-9]+$' \
    '^libxcb-image[0-9]+$' \
    '^libxcb-keysyms[0-9]+$' \
    '^libxcb-render-util[0-9]+$' \
    '^libxcb-xinerama[0-9]+$' \
    '^libxcb-xkb[0-9]+$' \
    '^libxkbcommon-x11-[0-9]+$'

If it didn't work, here's what I did to resolve the issue:

First, enable QT debug logging and run GALog.

export QT_DEBUG_PLUGINS=1
python -m galog

# Output:
# Got keys from plugin meta data ("xcb")
# QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
# Cannot load library /home/user/Documents/galog/venv/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)

The output indicates that libxcb-icccm.so is not found (and not installed). Therefore, we need to search for and install the package.

(venv) user@user-virtual-machine:~/Documents/galog$ sudo apt search libxcb-icccm
# Output
# Sorting... Done
# Full Text Search... Done
# libxcb-icccm4/jammy,now 0.4.1-1.1build2 amd64 [installed]
#   utility libraries for X C Binding -- icccm

sudo apt install libxcb-icccm4

After that, run GALog again. You may notice that another library is still missing.

python -m galog

# Output:
# Got keys from plugin meta data ("xcb")
# QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
# Cannot load library /home/user/Documents/galog/venv/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-image.so: cannot open shared object file: No such file or directory)

Repeat the same process with this library.

Eventually, after several attempts, you should have all the necessary libraries in place.

@poul1x poul1x closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant