Installing Leo in wsl Ubuntu-23.04

65 views
Skip to first unread message

lewis

unread,
Oct 16, 2024, 6:00:05 PM10/16/24
to leo-editor
Here is a summary procedure on running Leo on wsl Ubuntu-24.04 and some installation issues Edward experienced. Thomas - thanks for your comments on QtWayland.

I use the recommended github installation method. See https://leo-editor.github.io/leo-editor/installing.html
This summary is focused on using Git to install Leo.

Go to Microsoft Store
search Ubuntu-24.04 press Get button.

Installing, this may take a few minutes...
[SNIP]
Installation successful!

Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

[SNIP]

# Git is installed by default
lewisneal@PEGWS001:~$ git --version
git version 2.43.0


# Python3 is installed by default
lewisneal@PEGWS001:~$ python3 --version
Python 3.12.3


# Update Ubuntu
$ sudo apt-get update

# Install pip
# check if pip may already be installed with pip version
lewisneal@PEGWS001:~$ pip3 --version
 Command 'pip3' not found, but can be installed with:
 sudo apt install python3-pip


lewisneal@PEGWS001:~$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  [SNIP]
The following packages will be upgraded:
  [SNIP]
3 upgraded, 66 newly installed, 0 to remove and 32 not upgraded.
Need to get 83.0 MB of archives.
After this operation, 302 MB of additional disk space will be used.
Do you want to continue? [Y/n]

[SNIP]
# lots of unpacking. Here is summary, note that libatomic1 gets installed

Setting up python3-wheel (0.42.0-2) ...
Setting up libatomic1:amd64 (14.2.0-4ubuntu2~24.04) ...
Setting up python3-pip (24.0+dfsg-1ubuntu1) ...
[SNIP]
lewisneal@PEGWS001:~$


# Install Leo
$ git clone https://github.com/leo-editor/leo-editor.git
$ cd leo-editor


# Note - When using pip, the "--break-system-packages" option is needed.
# So use:
~/leo-editor$ python3 -m pip install --break-system-packages -r requirements.txt

# Lots of downloads....
[SNIP]
Successfully built meta
Installing collected packages: tk, snowballstemmer, PyQt6-WebEngineSubwheel-Qt6, PyQt6-Qt6, pscript, [SNIP] PyQt6-WebEngine, PyQt6-QScintilla, matplotlib, keyring, twine
  WARNING: The script depyc is installed in '/home/lewisneal/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
[SNIP]

 

# Install libxcb-cursor0
~$ sudo apt install libxcb-cursor0

# Run Leo. This shows the QtWayland issue.
lewisneal@PEGWS001:~/leo-editor$ python3 launchLeo.py
setting leoID from os.getenv('USER'): 'lewisneal'
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
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: wayland, wayland-egl, minimalegl, eglfs, vnc, xcb, linuxfb, offscreen, minimal, vkkhrdisplay.

Aborted (core dumped)
lewisneal@PEGWS001:~/leo-editor$


# Fix problem with qt.qpa.plugin:
$ sudo apt install qt6-wayland

# For information https://packages.ubuntu.com/noble/qt6-wayland
# or link suggested by Thomas: https://pkgs.org/download/qt6-wayland


# These 2 packages are required to fix AttributeError: 'NoneType' object has no attribute 'QWebEngineView'
$ sudo apt install libnss3  # required
$ sudo apt install libxkbfile1  # required



# This package is required to fix ImportError: libasound.so.2: cannot open shared object file: No such file or directory
$ sudo apt install libasound2t64

Finally I have Leo working fully on wsl Ubuntu-24.04, with both Freewin and VR3 plugins running. Leo starts and runs but you may still see error messages about qt.qpa.plugin.

Regards
Lewis

Thomas Passin

unread,
Oct 16, 2024, 6:46:05 PM10/16/24
to leo-editor
Wow, what a trek!  Thank you for pulling all this together for us.  And most of it will apply to any Ubuntu install, not just on WSL.

Edward K. Ream

unread,
Oct 17, 2024, 5:51:26 AM10/17/24
to leo-e...@googlegroups.com
On Wed, Oct 16, 2024 at 5:00 PM lewis <lewi...@fastmail.com.au> wrote:

Here is a summary procedure on running Leo on wsl Ubuntu-24.04 and some installation issues Edward experienced. Thomas - thanks for your comments on QtWayland.

Many thanks for this summary. I have just created info item #4106 to discuss Sage, IPython and Leo.

Edward

John Clark

unread,
Oct 17, 2024, 6:41:53 PM10/17/24
to leo-editor
Apologies in advance if these two options have already been mentioned: 
Just noting two alternative paths to get leo up and running that work great under linux and may also work (perhaps with some tweaking, perhaps not.... I can't say as I ditched Windows for linux 20 years ago):

UV - a rust alternative/successor to pip (Mac/Linux/Windows)

With uv installed (which is as simple as downloading and giving exec permissions to the prebuilt binary), Leo is running in a matter of seconds on my linux box via the one liner:
uv run --with leo leo
(of course uv has all the knobs to specify specific versions etc)
uv will even install it's own version of python
uv has many more features than pip

If this doesn't work either on windows directly or via WSL, then (via the --script feature of uv) it shouldn't be difficult to write a single .py wrapper script, containing specifically-tweaked dependency metadata, to run leo with a bespoke list of dependendencies.


nix - (Mac/Linux/Windows-via-WSL2)
I recommend the alternate nix installer by Determinate Systems:

nix is an amazing package manager.

When nix is installed via the Determinate installer (which uses flakes by default), then nix is up and running (without even being "installed") with this one liner:
nix run nixpkgs#leo-editor

Warning: There is quite a learning curve to nix. But once you're over the hump, there's no going back.

I hope these options help.

Cheers

Edward K. Ream

unread,
Oct 17, 2024, 9:19:52 PM10/17/24
to leo-e...@googlegroups.com
On Thu, Oct 17, 2024 at 5:41 PM John Clark <leve...@theinsideworld.net> wrote:
Apologies in advance if these two options have already been mentioned: 

No need ever to apologize. And these are great new ideas.

I'll try them out.

Edward

Edward K. Ream

unread,
Oct 18, 2024, 4:17:28 AM10/18/24
to leo-e...@googlegroups.com
On Thu, Oct 17, 2024 at 8:19 PM Edward K. Ream <edre...@gmail.com> wrote:
On Thu, Oct 17, 2024 at 5:41 PM John Clark <leve...@theinsideworld.net> wrote:
Apologies in advance if these two options have already been mentioned: 

No need ever to apologize. And these are great new ideas.

On second thought, using a new package manager is unlikely to help. The problem is with wsl, not Leo.

Again, no need to apologize. Everything about the SageMath project is tricky and confusing. Every morning I awake with new ideas. This morning I see that maybe installing (in wsl) a driver for my RTX 3080 graphics board might help.

I'm going to put wsl issues on hold temporarily and concentrate on an easier problem. Leo issue #4105 suggests fixing Leo's ancient IPython bridge. SageMath runs on top of IPython, so investigating IPython is relevant. I'll say more in another post.

Edward
Reply all
Reply to author
Forward
0 new messages