Testing "execute-external-file" command on wsl linux

76 views
Skip to first unread message

lewis

unread,
Oct 12, 2024, 4:17:32 AM10/12/24
to leo-editor
I have been setting up to use the "execute-external-file" command for #4091.
Node @data run-external-processor-map  is in myLeoSettings.leo and includes these lines:
# Optionally specify a Linux terminal (e.g., konsole) on the
# line after the "TERMINAL" line.
TERMINAL
konsole

Running wsl openSUSE-Tumbleweed
Leo 6.8.2-devel, devel branch, build 92e7ab6e80
2024-10-12 02:01:07 -0500
Python 3.12.7, PyQt version 6.7.3

Konsole is installed.

When I run execute-external-file command I get error:
Traceback (most recent call last):
  File "/home/lewisneal/leo-editor/leo/core/leoGlobals.py", line 318, in new_cmd_wrapper
func(self, event=event)
  File "/home/lewisneal/leo-editor/leo/core/leoCommands.py", line 1072, in execute_external_file
processor_map, extension_map, terminal = get_external_maps()
^^^^^^^^^^^^^^^^^^^
  File "/home/lewisneal/leo-editor/leo/core/leoCommands.py", line 849, in get_external_maps
processor_map = scan_map('PROCESSORS')
^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lewisneal/leo-editor/leo/core/leoCommands.py", line 837, in scan_map
val = keyval[1].strip()
~~~~~~^^^
IndexError: list index out of range


Thomas Passin

unread,
Oct 12, 2024, 8:12:50 AM10/12/24
to leo-editor
By coincidence, I'm in the middle of working on the command.  I'll try to see what's going on there.  In the meantime, I *think* that the command will pick up konsole without you having to list it. I do have an Open-SUSE VM (not on wsl) but I added Cinnamon to it and IIRC the command finds gnome-terminal first before konsole.  I'll get back here with what I find out.  What kind of program are you trying to run?  If it's a Python program you won't need to put anything into the @data node.. 

Thomas Passin

unread,
Oct 12, 2024, 9:57:41 PM10/12/24
to leo-editor
It's a definite bug.  I don't know where my mind was when I wrote that bit of code, because it can't work.  I probably changed the design of the @data node but forgot to follow up in the code. I'll file an issue and get out a PR.

Edward K. Ream

unread,
Oct 13, 2024, 10:11:59 AM10/13/24
to leo-editor
On Saturday, October 12, 2024 at 3:17:32 AM UTC-5 lewis wrote:

I have been setting up to use the "execute-external-file" command for #4091.
...

Running wsl openSUSE-Tumbleweed

Wow. I never heard of wsl before yesterday. Now I'm using it to run SageMath.

Leo will be a killer app for SageMath, but  I'm having a devil of a time running Leo on Ubuntu (inside wsl).

`pip install leo` appears to work, and after some futzing Leo's outline appears, but there are problems.

Perhaps my Bios does not enable "hardware assisted virtualization".
I can't find any such setting on my Z590-A Pro motherboard.

Summary

I would be interested in everyone's experiences running Leo on wsl.

Edward

Thomas Passin

unread,
Oct 13, 2024, 10:46:28 AM10/13/24
to leo-editor
After reading about how to get a distro running on wsl I'm reluctant to try it. It seems complicated and trouble prone.  Still someone recently posted here that they got EndeavorOS working well on wsl.  I've been trying EndeavourOS as a VM in Virtualbox and I like it a lot.  It's based on ArchLinux, so you have to learn to use pacman instead of apt-get, and you have to install more things yourself, but even with that learning curve I prefer it to Mint, which was my previous favorite.

Whichever distro you choose, I like the Cinnamon desktop manager much better that the new Gnome that Ubuntu and many  of the others use.

Edward K. Ream

unread,
Oct 13, 2024, 12:54:21 PM10/13/24
to leo-e...@googlegroups.com
On Sun, Oct 13, 2024 at 9:46 AM Thomas Passin <tbp1...@gmail.com> wrote:
After reading about how to get a distro running on wsl I'm reluctant to try it. It seems complicated and trouble prone.  Still someone recently posted here that they got EndeavorOS working well on wsl.  I've been trying EndeavourOS as a VM in Virtualbox and I like it a lot.  It's based on ArchLinux, so you have to learn to use pacman instead of apt-get, and you have to install more things yourself, but even with that learning curve I prefer it to Mint, which was my previous favorite.

`pip install pacman` seems to work. And pip worked out of the box.

Whichever distro you choose, I like the Cinnamon desktop manager much better that the new Gnome that Ubuntu and many  of the others use.

Thanks for these comments!

Edward

Thomas Passin

unread,
Oct 13, 2024, 1:03:40 PM10/13/24
to leo-editor
On Sunday, October 13, 2024 at 12:54:21 PM UTC-4 Edward K. Ream wrote:
`pip install pacman` seems to work. And pip worked out of the box.

I don't know what "pacman" this was, but the one I'm referring to is the system's program to install and manage system packages, playing the role of apt/apt-get, yum, zypper, etc. It's not something that would be pip-installable.

Edward K. Ream

unread,
Oct 13, 2024, 2:01:30 PM10/13/24
to leo-e...@googlegroups.com
Never mind. You're quite right.

SLAT(Second-Level Address Translation)

The Microsoft Docs say that SLAT is required for wsl, but clearly that's not correct:
- My motherboard does not support SLAT.
- I'm running Ubuntu and SageMath without any apparent problem.

Running Leo

After `pip install leo`, `pip list` says (in part):

leo                           6.8.1
PyQt6                         6.7.1
PyQt6-QScintilla              2.14.1
PyQt6-Qt6                     6.7.3
PyQt6_sip                     13.8.0
PyQt6-WebEngine               6.7.0
PyQt6-WebEngine-Qt6           6.7.3
PyQt6-WebEngineSubwheel-Qt6   6.7.3

Alas, SLAT may really be necessary to run Qt6.

Summary

I'm having a ton of fun with wsl. For the first time ever I can switch back and forth between Windows 11 and Ubuntu. That's worth a lot, regardless of the problems.

To repeat, SageMath "just works" on wsl.

Edward

Jacob Peck

unread,
Oct 13, 2024, 3:18:57 PM10/13/24
to leo-e...@googlegroups.com
SLAT is processor-dependent, not motherboard-dependent.  It goes by different names between Intel (EPT) and AMD (RVI) processors.  If you’re running on a non-ancient system, it’s likely your processor supports SLAT these days.  You’d be hard-pressed to find a processor that does not support it.

Jake

On Oct 13, 2024, at 2:01 PM, Edward K. Ream <edre...@gmail.com> wrote:


--
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/CAMF8tS186Z-E-6mNz3xTtG6SmDeWXh_6JUMSW4QDDjVuFxUceQ%40mail.gmail.com.

Edward K. Ream

unread,
Oct 13, 2024, 5:18:06 PM10/13/24
to leo-e...@googlegroups.com
On Sun, Oct 13, 2024 at 2:18 PM Jacob Peck <gates...@gmail.com> wrote:
SLAT is processor-dependent, not motherboard-dependent.  It goes by different names between Intel (EPT) and AMD (RVI) processors.  If you’re running on a non-ancient system, it’s likely your processor supports SLAT these days.  You’d be hard-pressed to find a processor that does not support it.

Thanks for this. It's a mystery why Windows 11 is not running with the Hyper-V services.

Edward

Jacob Peck

unread,
Oct 13, 2024, 6:07:29 PM10/13/24
to leo-e...@googlegroups.com
Hyper-V services are only 'entitled' to run on Win 11 Pro or Enterprise -- if you have Win 11 Home, you're out of luck.  Another case of MS needlessly segmenting features away from the most affordable licenses. 

If you do have Pro or Enterprise, perhaps give this a go (assuming you haven't already): https://techcommunity.microsoft.com/t5/educator-developer-blog/step-by-step-enabling-hyper-v-for-use-on-windows-11/ba-p/3745905

Jake

--
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.

Edward K. Ream

unread,
Oct 14, 2024, 2:51:44 AM10/14/24
to leo-e...@googlegroups.com
On Sun, Oct 13, 2024 at 5:07 PM Jacob Peck <gates...@gmail.com> wrote:

Hyper-V services are only 'entitled' to run on Win 11 Pro or Enterprise -- if you have Win 11 Home, you're out of luck.  Another case of MS needlessly segmenting features away from the most affordable licenses. 

Jake, you're a peach. I've just upgraded to Windows Pro. It took about 5 minutes.

Edward

lewis

unread,
Oct 15, 2024, 4:44:07 AM10/15/24
to leo-editor
Thomas, thanks for the update. I'm running build c22c944ab2
Konsole is not working currently, so I updated Node @data run-external-processor-map  in myLeoSettings.leo to specify qterminal :
# Optionally specify a Linux terminal (e.g., konsole) on the
# line after the "TERMINAL" line.
TERMINAL
qterminal


When I run execute-external-file command it opens a qterminal with tab named "Shell No. 1" and a single line:
/usr/bin/bash: line 1: /home/lewisneal/test_leo.py: Permission denied

Any idea why the Permission denied message occurs?
 
Lewis

Thomas Passin

unread,
Oct 15, 2024, 8:45:34 AM10/15/24
to leo-editor
I have no idea.  There's no reason that "sudo" should be required.  But the revised code is just now in the devel branch.  It should recognize and use konsole without a need to specify it in the @data node. Please try it out.

I tested it myself with my own single-line Python script and it worked:

print('This is a test')

You might get that output from running a script with a shebang line, if that script didn't have execute permissions.  But the command's code inserts Python into the command line so that shouldn't be an issue.

I tested the new code on OpenSUSE/KDE, which uses konsole, and EndeavourOS/Cinnamon, which uses gnome-terminal.
Reply all
Reply to author
Forward
0 new messages