Failed installation on Ubuntu 22.04LTS (both git and pip methods)

24 views
Skip to first unread message

David McNab

unread,
May 7, 2023, 7:32:28 AM5/7/23
to leo-editor
Hi there,

I'm getting back to Leo after some years away. However, the installation is failing on my Ubuntu 22.04LTS system.

I carefully followed the instructions for git install, and the pip step installed quite a few other packages, some of which mentioned PyQt.

But when I ran 'leo', what I got was:

'NoneType' object has no attribute 'gui'

I then ran 'pip uninstall leo' in an attempt to clean it out, then 'pip install leo' to follow the pip installation method.

Again, when running leo, the same error.

Any suggestions?

Cheers
David

Thomas Passin

unread,
May 7, 2023, 8:35:50 AM5/7/23
to leo-editor
Someone else recently had problems on Ubuntu 22 LTS.  Look at this discussion here on the Groups site:


The OP never said how or if Leo finally got to work, so I've been hoping some of the suggestions helped.

In general, I have provisioned a lot of Linux VMs with Leo, including Ubuntu 22, with success.  Sometimes a shared library is missing - I mean a .so file, not a Python library.  Once or twice, IIRC, I had to install Qt itself, beyond PyQt, to get all the necessary parts.  But I don't remember all the details or even which Linux distro was involved.

In your case, beyond suggestions on the other thread, I'd probably try to use the package manager to install Qt (it may already be present because some other program uses it, but maybe not).  Some desktop managers themselves use Qt, some do not.  You can probably find out about Ubuntu's with some internet searching.

On my own Ubuntu 22.04 VM (which Leo works on), a search for directories starting with "Qt" gave this:

tom@tom-ubuntu-VirtualBox:~$ find / -type d -name Qt 2>/dev/null
/usr/lib/python3/dist-packages/orca/scripts/toolkits/Qt
/home/tom/.local/lib/python3.10/site-packages/PyQt5/Qt5/qml/Qt
/home/tom/.local/lib/python3.8/site-packages/PyQt5/Qt
/home/tom/.local/lib/python3.8/site-packages/PyQt5/Qt/qml/Qt
/home/tom/.local/lib/python3.8/site-packages/PyQt5/Qt5/qml/Qt

Don't forget the 2>/dev/null or the output will be dominated by zillions of "permission denied" messages!

Thomas Passin

unread,
May 7, 2023, 10:44:46 AM5/7/23
to leo-editor
I created a new Ubuntu VM with 22.04.2.  To install the "guest additions" so that the Ubuntu window could be resized ot something useful, I had to run

sudo apt-get install gcc make perl

I installed pip with 

sudo apt install python3-pip

Then I installed Leo from PyPi:

python3 -m pip install --user leo

Leo failed to run:

python3 -m leo.core.runLeo

The error message included a line I've seen before:

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

I remembered that I've encountered this before and solved it by installing a .so library.  It's some kind of a packaging error by Ubuntu.  I couldn't find any notes about doing so, so I searched the internet, but the best-looking solution I tried didn't fix the problem.

Rather than spend more time, I just installed PyQt6 and after this Leo runs:

python3 -m pip install --user pyqt6

To get the viewrendered3 plugin to work, you will also need to install the WebEngine for PyQt6:

python3 -m install --user PyQt6-WebEngine

Thomas Passin

unread,
May 7, 2023, 11:27:34 AM5/7/23
to leo-editor
After my last post, I found the fix for the "xcb" problem with PyQt5.  It was in a discussion thread from several years ago, and I haven't verified that it still works (but I suspect it does):

sudo apt-get install libxcb-xinerama0

Reply all
Reply to author
Forward
0 new messages