tasmotizer icon indicating copy to clipboard operation
tasmotizer copied to clipboard

PyQt 5.15 issue with Debian Buster 10.7 [workaround]

Open Mrnt opened this issue 4 years ago • 6 comments

Issue

Installed Tasmotizer in a virtual environment on Debian Buster 10.7 using the "Option 2" instructions:

Option 2: Install from PyPI using pip:

  • Upgrade pip and wheel packages: pip3 install --upgrade pip wheel
  • Install tasmotizer: pip3 install tasmotizer
  • Then simply run tasmotizer.py from the shell/command line

When running Tasmotizer on Debian Buster the app fails to start - the output includes the following 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.

Setting export QT_DEBUG_PLUGINS=1 then running Tasmotizer again gives some additional information:

Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/-path_to_venv-/bin/platforms" ...
Cannot load library /-path_to_venv-/lib/python3.7/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/-path_to_venv-/lib/python3.7/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /-path_to_venv-/lib/python3.7/site-packages/PySide2/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: 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.

Cause

It appears that as of PyQt5 5.15, the Qt plugin libqxcb.so is expecting to find the module libxcb-util.so.1 eg: /lib/x86_64-linux-gnu/libxcb-util.so.1 However, Debian Buster (version 10.7) only has libxcb-util.so.0 This change was apparently made in PyQt 5.15.

Possible Solution

One possible solution might be to pin the max requirement for PyQt5 to 5.14.2 though I have not tested this (I opted to make a symbolic link called libxcb-util.so.1 in the same folder as libxcb-util.so.0 that pointed to libxcb-util.so.0, which seems to work), eg:

sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1

Mrnt avatar Jan 06 '21 22:01 Mrnt

Oh that's interesting, as it actually might finally be a solution to many XCB related issues posted! Thanks! I'll forward other users who posted this issue to this one so we can verify!

jziolkowski avatar Jan 06 '21 22:01 jziolkowski

Requirements.txt changed to 5.14

Jason2866 avatar Mar 04 '21 19:03 Jason2866

sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1 solved my problem

jvw1954 avatar Mar 10 '21 22:03 jvw1954

I got this same error on Ubuntu 20.04 and resolved it by running sudo apt install libxcb-xinerama0

houldsg avatar Jan 14 '22 01:01 houldsg

sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1 solved my problem

This is the solution in debian 10.11

algspd avatar Feb 05 '22 10:02 algspd

sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1 solved my problem

ASTRA LINUX

Vlad0zz avatar Sep 29 '22 11:09 Vlad0zz