Leo doesn't start because of some Qt-problems

216 views
Skip to first unread message

p.os...@datec.at

unread,
Jul 22, 2024, 5:40:34 AM7/22/24
to leo-editor
Issuing

export QT_DEBUG_PLUGINS=1 && leo

yields

setting leoID from os.getenv('USER'): 'XXXXX'
qt.core.plugin.factoryloader: checking directory path "/usr/bin/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Everything with "xcb" in its name seems installed (I'am on endeavourOS).
Any idea, how I could proceed?

What I did so far:
- Update the whole system (endeavourOS)
- Update Leo from PYPI

Cheers
Paul

Thomas Passin

unread,
Jul 22, 2024, 6:22:55 AM7/22/24
to leo-editor
This error comes up with small variations for some Linux systems.  Many times the error message will continue to suggest a command line  for installing the required library.  That library may already be installed but not the right version.  If there was no suggestion, search online for how to install it for your system.  Often the library is named libxcb-cursor0 but sometimes it goes by a different name.  Here's a site than can help finding the right install package: http://pkgs.org/

On Ubuntu systems, this command used to work (I don't know if it still does):

sudo apt-get install libxcb-xinerama0

Sometimes the required library goes by this name: libqxcb.so instead.  Sometimes the error message will suggest two possible names instead of just the one. Try them both if the first doesn't do the job.

Thomas Passin

unread,
Jul 22, 2024, 6:28:47 AM7/22/24
to leo-editor
Here is a page that has some good information about fixing this problem in case my previous post doesn't:

Briefly, you can get a more complete error message by setting this environmental variable before launching Leo:

export QT_DEBUG_PLUGINS=1

p.os...@datec.at

unread,
Jul 22, 2024, 7:20:05 AM7/22/24
to leo-editor
Installed xcb-util-cursor, libxinerama. Reinstalled PyQt5, PyQt6 - to no avail.

Thomas Passin

unread,
Jul 22, 2024, 8:50:10 AM7/22/24
to leo-editor
Try setting that debug variable:  export QT_DEBUG_PLUGINS=1
Maybe the Qt message will be more informative.  BTW, you don't need PyQt5.  Leo doesn't use it any more.  Please post the Qt error message here if you can't resolve the problem.

Thomas Passin

unread,
Jul 22, 2024, 9:24:05 AM7/22/24
to leo-editor
Sorry, I forgot you had already set the variable.  But what's with the "&&leo"? The error message you should looks just like the ones I've seen without the variable.  With it you're supposed to get more details.

Jacob Peck

unread,
Jul 22, 2024, 9:30:57 AM7/22/24
to leo-e...@googlegroups.com
Thomas, their very first post in this thread indicated they did run with that env var set.

Please try (re-)installing qt6-utilis.  That fixed it on my Arch install, and I assume Endeavor uses the arch packages.

Jake

On Jul 22, 2024, at 8:50 AM, Thomas Passin <tbp1...@gmail.com> wrote:

Try setting that debug variable:  export QT_DEBUG_PLUGINS=1
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/c2d16273-5d73-45d6-85f0-364af7f1d0f4n%40googlegroups.com.

Jacob Peck

unread,
Jul 22, 2024, 9:33:28 AM7/22/24
to leo-e...@googlegroups.com
&&leo means the ‘leo’ command will only run if the previous  statement (setting the env variable) succeeds.

Jake

On Jul 22, 2024, at 9:24 AM, Thomas Passin <tbp1...@gmail.com> wrote:

Sorry, I forgot you had already set the variable.  But what's with the "&&leo"? The error message you should looks just like the ones I've seen without the variable.  With it you're supposed to get more details.
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.

Jacob Peck

unread,
Jul 22, 2024, 9:34:41 AM7/22/24
to leo-e...@googlegroups.com
Apologies, pkg name is ‘qt6-tools’, not ‘qt6-utils’.

Jake

On Jul 22, 2024, at 9:30 AM, Jacob Peck <gates...@gmail.com> wrote:



p.os...@datec.at

unread,
Jul 22, 2024, 10:48:32 AM7/22/24
to leo-editor
Latest qt6-tools are Installed already. Installed qtutilities-qt6. No luck.

As for the "&& leo" after setting the env var: That means: "and then start leo".

Setting the env var did not show more helpful text, alas.

Thomas Passin

unread,
Jul 22, 2024, 10:56:48 AM7/22/24
to leo-editor
It's still got to be some library in the xcb library system. So far as I can see it's a Qt problem, not really a Leo one - although that doesn't help, does it? Just having them already installed isn't always enough. I remember one of my VMs had the culprit installed, but after I ran the installation command for it then Qt worked.  I don't remember any details, though.  I also recall that in one case the library name was different from the one or two that had been suggested in the error message.  That time I lucked out with an Internet search.

Which distro is this, BTW?

Thomas Passin

unread,
Jul 22, 2024, 11:21:07 AM7/22/24
to leo-editor
If your system uses Wayland2, there's another environmental variable that might help:

p.os...@datec.at

unread,
Jul 22, 2024, 11:21:09 AM7/22/24
to leo-editor
It's endeavourOS (Arch derivate).

Yes, it is a Qt problem and probably caused by the recent update of the OS (that's the disadvantage of a rolling release: You get the Latest and greatest, but also the latest bugs ;-) )

Thought I'd be a good idea to ask here first, because I hear the Qt people already say, "the error says it all: Reinstall the app" ;-) Well, next stop endeavourOS, then Qt, I guess?

Thanks for your efforts!

Paul

Jacob Peck

unread,
Jul 22, 2024, 11:24:57 AM7/22/24
to leo-e...@googlegroups.com
Does the file /usr/lib/qt6/plugins/platforms/libqxcb.so exist on your system?

Could you try re-installing package `qt6-base`, if not?

Jake

p.os...@datec.at

unread,
Jul 22, 2024, 11:32:33 AM7/22/24
to leo-editor
Yes, /usr/lib/qt6/plugins/platforms/libqxcb.so exists. Setting the mentioned env var to wayland brings up the same error, with "wayland" instead of "xcb" in the error text. It seems that there is a directory path that didn't get set or has been deleted: 'not found in ""'.

Thomas Passin

unread,
Jul 22, 2024, 11:38:56 AM7/22/24
to leo-editor
I wonder if installing an earlier version of PyQt6 would work?

Lots of folks with many Qt-based programs have xcb problems.  It's not just one release, it's a persistent problem.

Jacob Peck

unread,
Jul 22, 2024, 11:44:42 AM7/22/24
to leo-e...@googlegroups.com
Super fun.

You could try setting (one or both of) these before running leo, and seeing if that makes any difference.

QT_QPA_PLATFORM_PLUGIN_PATH= /usr/lib/qt6/plugins/platforms/
QT_PLUGIN_PATH= /usr/lib/qt6/plugins/platforms

Another possibility is a bad copy of libqxcb.so in your /home/<username>/.local/lib/python3.<version>/site-packages directory somewhere.  I've never installed leo via pip, but if it pulled in a copy of that lib somewhere in there that's not playing well with the system libs, that'd be a possibility.  IIRC the 'cv2' python lib ships that library with it, maybe see if that's in there somehow?  Or just do a recursive find for it -- `find /home/<username>/.local/lib/python3.<version>/site-packages -name libqxcb.so -ls` (or similar).

Sorry this is being one of those mystery pains. :(

Jake

Thomas Passin

unread,
Jul 22, 2024, 12:03:05 PM7/22/24
to leo-editor
I found an xcb library in the Pillow directory on one of my VMs:

/home/tom/.local/lib/python3.11/site-packages/Pillow.libs/libxcb-3e83370d.so.1.1.0

Could this library be conflicting?  If so, Updating Pillow might do it.

Thomas Passin

unread,
Jul 22, 2024, 4:32:47 PM7/22/24
to leo-editor
I just got the EndeavourOS iso and installed it in a new Virtual Machine.  Then I installed Leo into a new venv.  It worked first time.  No xcb messages.  That's good news.

p.os...@datec.at

unread,
Jul 23, 2024, 1:44:14 AM7/23/24
to leo-editor
I knew I am right here:

QT_QPA_PLATFORM_PLUGIN_PATH= /usr/lib/qt6/plugins/platforms/
QT_PLUGIN_PATH= /usr/lib/qt6/plugins/platforms

did it! So, yet no need to downgrade. Many many thanks!

As for the reinstall of endeavourOS: Could mean, that there are new Qt libs and packages, that fix the bug. I'll check that.

Again: Many thanks to you all!
Paul

p.os...@datec.at

unread,
Jul 23, 2024, 2:26:35 AM7/23/24
to leo-editor
Shouldn't I mark this thread as solved? How do I do that? And, OT, yet I could not figure how to answer a specific poster. There's only a "Reply All" button.

Thomas Passin

unread,
Jul 23, 2024, 7:30:29 AM7/23/24
to leo-editor
Good work!  BTW, on my Linux Mint VM that path is /home/tom/.local/lib/python3.11/site-packages/PyQt6/Qt6/plugins/platforms.  The file of interest there must be libqxcb.so.
The system's plugins/platform is in /usr/lib and is only for qt5.

So we don't necessarily have a one-size-fits-all solution, but we're closer.  If you have the locate command:

tom@tom-VirtualBox:~$ locate -r 'platforms$' |grep -i qt6
/home/tom/.local/lib/python3.11/site-packages/PyQt6/Qt6/plugins/platforms


otherwise (much slower)

tom@tom-VirtualBox:~$ find / 2>/dev/null -type d -name platforms |grep -i 'qt6'
/home/tom/.local/lib/python3.11/site-packages/PyQt6/Qt6/plugins/platforms

Jacob Peck

unread,
Jul 23, 2024, 8:13:09 AM7/23/24
to leo-e...@googlegroups.com
Paul, glad that worked!  I must admit I was a bit skeptical that it would, but glad we got there.

Thomas, the qt6 dir I messaged is for Arch Linux — EndeavorOS is arch based and I have a working Arch environment.  That’s the only reason I could figure that part out.  What’s odd is that I *don’t* have to specify those paths on my Arch environment.

Also, Thomas, if you’re only finding qt6 plugins under your Python site-packages on a Mint vm, I suspect you might not have the system qt6 packages installed.  If you do, I have *no* idea what’s happening in Debian/Ubuntu/Mint land any longer 😅.

Jake

On Jul 23, 2024, at 7:30 AM, Thomas Passin <tbp1...@gmail.com> wrote:

Good work!  BTW, on my Linux Mint VM that path is /home/tom/.local/lib/python3.11/site-packages/PyQt6/Qt6/plugins/platforms.  The file of interest there must be libqxcb.so.

Thomas Passin

unread,
Jul 23, 2024, 8:44:02 AM7/23/24
to leo-editor
My Mint system has all those system Qt libraries, and they are Qt5 not Qt6.  If I started again with a new iso it would probably be using Qt6, I bet.

Thomas Passin

unread,
Jul 23, 2024, 12:59:42 PM7/23/24
to leo-editor
On my new EndeavourOS VM, I have all of these:

[tom@tom-endeavour ~]$ locate -r 'platforms$' |grep -i qt6
python3.12/site-packages/PyQt6/Qt6/plugins/platforms
/usr/lib/cmake/Qt6/platforms
/usr/lib/qt6/plugins/platforms

I suppose it's possibly to get version conflicts between the system's qt6 libraries and the ones for the PyQt6 version installed for Leo.  In that case we might still get an error.  Maybe the exported paths should point to the Python version, although only for that Leo session.

Jacob Peck

unread,
Jul 23, 2024, 1:05:59 PM7/23/24
to leo-e...@googlegroups.com
On Arch specifically (and its derivatives like Endeavor and Manjaro), the .so libs pulled in by pip generally cause issues when they override the system-level libs (just due to how tightly-integrated all the Arch packages are).  I actually recommend overriding the python libs with the system libs on Arch.

I also recommend avoiding installing things via pip on Arch, unless you're in a venv or other non-system python install.

Arch is great!  But it can give you an ample supply of foot-guns if you don't keep things tidy.

Jake

Thomas Passin

unread,
Jul 23, 2024, 1:22:34 PM7/23/24
to leo-editor
On Tuesday, July 23, 2024 at 1:05:59 PM UTC-4 gates...@gmail.com wrote:
On Arch specifically (and its derivatives like Endeavor and Manjaro), the .so libs pulled in by pip generally cause issues when they override the system-level libs (just due to how tightly-integrated all the Arch packages are).  I actually recommend overriding the python libs with the system libs on Arch.

I'm thinking of a situation where PyQt6 gets updated to say 6.8, while system is still at 6.7.5.  I certainly wouldn't want to point the whole OS system to the Python version of the Qt libraries.  Any change to the path would have to be local to the process that is running Leo.

I have a Manjaro VM, and that's based on Arch. It's very nice.  I'm not so taken with pacman, though. It seems I have to remember several command line flags just to do a basic install. And then there don't seem to be an equivalents for apt-get autoremove and apt-get autoclean. I see conflicting recipes on line.

I also recommend avoiding installing things via pip on Arch, unless you're in a venv or other non-system python install.

Generally a good thing, although I've been sloppy about that on other distros in the past.  I'm not sure how to go about installing Python package that aren't in Arch packages, if pip isn't used.  If you are not running pip as root it will install as --user.  That's what I usually did and then I encountered those "break-system-packages" messages.  If we don't install using --user then what alternative is there except a venv or equivalent?  For Leo, I set the PYTHONPATH to point to my git clone repo, but that approach wouldn't be practical for all its dependencies.
Reply all
Reply to author
Forward
0 new messages