glitches installing and starting Leo

127 views
Skip to first unread message

andyjim

unread,
May 14, 2024, 8:46:30 AM5/14/24
to leo-editor
  • I am not a techie, but I want to try using Leo as an organizer. I may try building something like Johnny Decimal type indexing in Leo to organize files, and use an external app for my actual journaling (Bike Outliner), since as I understand it Leo can organize files and I can open them in their native app from Leo.

  • My use case is notes and files organization, journaling, hopefully writing a book. Leo seems like a tough road for a non-techie. It was a challenge just installing it (on Mac 14.4.1), and Terminal gave me an error:

  • TypeError: expected str, bytes or os.PathLike object, not NoneType

  • I don’t know what it means or what to do about it.

  • After Python installation (I failed with miniconda and with brew) Leo launched with ``Leo``, but with the same error as above.

  • On Leo startup there was no menu bar in the main window and I somehow managed to lose the icon area.

  • Next day now, I cannot start it with ``leo`` (zsh: command not found) and I don’t know how to start it.

    I had Leo a few years ago (don't recall what version) and as I recall it started from a desktop icon, not from terminal.

Edward K. Ream

unread,
May 15, 2024, 7:06:44 AM5/15/24
to leo-e...@googlegroups.com
On Tue, May 14, 2024 at 7:46 AM andyjim <andy...@gmail.com> wrote:

> Leo seems like a tough road for a non-techie.

My apologies. It shouldn't the that tough :-)

> It was a challenge just installing it (on Mac 14.4.1), and Terminal gave me an error:

> TypeError: expected str, bytes or os.PathLike object, not NoneType

In the future, it's good to record the entire console message. That will tell me where the problem lies.

Do you have a copy of the console message?

The other problems you report may have been the result of the TypeError.

Edward

andyjim

unread,
May 15, 2024, 7:54:28 AM5/15/24
to leo-editor
I spoke from frustration, sir. I should not complain so loudly on day one.
No I don't have the complete message. Should I uninstall and start over? If so, how do I uninstall?
And is there a more likely install path than what I used:
I tried miniconda first (seemed simplest), then brew. Sorry, I don't have record of the breakdown of those two install attempts.

Thomas Passin

unread,
May 15, 2024, 9:50:25 AM5/15/24
to leo-editor
It's a little hard to help with Mac-related problems because most of the developer-minded people (like Edward and myself) don't have Macs to try things out on.  Most of the people with Macs seem to be more like you - user-minded rather than developer-minded.

You could try searching through the threads on this group using the search box at upper right.  I tried "install mac" and got a number of hits, one of which is this one: https://groups.google.com/g/leo-editor/c/GgYQNRQed9o/m/LMTLC6sZAgAJ. I also found Using MacPorts to deploy Leo on macOS computers using the search phrase "installing leo on Macs". Other people have wrestled with Mac installation problems and you may find something that applies directly to you.

I also tried an on-line search for "problems installing leo on Macs" and saw this: How to install Leo under M1 chip macOS 12. Note that this post is a little out of date: you need to use pyqt6 instead of pyqt5; the python version it uses is not the current one.  But it might help you if you remember to adjust those little version-related kinds of things.

HTH

Edward K. Ream

unread,
May 15, 2024, 10:31:11 AM5/15/24
to leo-e...@googlegroups.com
On Wed, May 15, 2024 at 6:54 AM andyjim <andy...@gmail.com> wrote:
I spoke from frustration, sir. I should not complain so loudly on day one.
No I don't have the complete message. Should I uninstall and start over? If so, how do I uninstall?

It would be helpful if you could reproduce the message.

`pip uninstall leo` might work :-)

Edward

Edward K. Ream

unread,
May 15, 2024, 10:33:36 AM5/15/24
to leo-e...@googlegroups.com
On Wed, May 15, 2024 at 8:50 AM Thomas Passin <tbp1...@gmail.com> wrote:
It's a little hard to help with Mac-related problems because most of the developer-minded people (like Edward and myself) don't have Macs to try things out on. 

I do have a Mac, but I have been lax about testing. I typically update Leo using git.

I've just made a note to myself about testing a clean MacOS install.

Edward

andyjim

unread,
May 15, 2024, 11:23:14 AM5/15/24
to leo-editor
Thanks Edward and tbp1 (Thomas, is it?) 
I just rolled the dice and figured it shouldn't hurt to just install again.
I used:  python -m pip install Leo
It ran through install apparently without a hitch
I launched with: leo  (not ``leo``)
Leo launched, but no menu bar. Also got TypeError. Here is the whole output:
  • setting leoID from os.getenv('USER'): 'andy'

    Leo 6.7.8

    Python 3.9.19, PyQt version 6.7.0

    darwin

    load_session Ignoring invalid session unl: 'unl:gnx:///Users/andy/.leo/workbook.leo#andy.20240513222826.1'

    qt.qpa.fonts: Populating font family aliases took 355 ms. Replace uses of missing font family "DejaVu Sans Mono" with one that exists to avoid this cost. 

    unexpected error creating: None

    Traceback (most recent call last):


      File "/opt/miniconda3/lib/python3.9/site-packages/leo/commands/spellCommands.py", line 65, in create

        f = open(fn, mode='wb')


  • TypeError: expected str, bytes or os.PathLike object, not NoneType



  • I'll go ahead and get acquainted with it and see how she rolls from here. It would be nice to have a menu bar though.

    Sorry I didn't figure out how to change the format/font back after the copy paste.


    Andy

Edward K. Ream

unread,
May 15, 2024, 12:17:13 PM5/15/24
to leo-e...@googlegroups.com
On Wed, May 15, 2024 at 10:23 AM andyjim <andy...@gmail.com> wrote:
Thanks Edward and tbp1 (Thomas, is it?) 

You're welcome. Yes, it's Thomas Passin.

I just rolled the dice and figured it shouldn't hurt to just install again.
 
Very brave :-)

Leo launched, but no menu bar. Also got TypeError. Here is the whole output:
  • setting leoID from os.getenv('USER'): 'andy'

    Leo 6.7.8

    Python 3.9.19, PyQt version 6.7.0

    darwin

    load_session Ignoring invalid session unl: 'unl:gnx:///Users/andy/.leo/workbook.leo#andy.20240513222826.1'

    qt.qpa.fonts: Populating font family aliases took 355 ms. Replace uses of missing font family "DejaVu Sans Mono" with one that exists to avoid this cost. 

    unexpected error creating: None

    Traceback (most recent call last):


      File "/opt/miniconda3/lib/python3.9/site-packages/leo/commands/spellCommands.py", line 65, in create

        f = open(fn, mode='wb')


    TypeError: expected str, bytes or os.PathLike object, not NoneType

Excellent. This is a real bug.  Thanks for your testing.

Edward

Thomas Passin

unread,
May 15, 2024, 12:22:18 PM5/15/24
to leo-editor
The Type error message is from the spellchecker.  It wants to create a file to hold new words it doesn't know, but it was not passes an actual filename.  It shouldn't affect the rest of Leo's operation and may not even prevent the spell checker from working.

As to the menu, don't application main menus appear at the top of the screen for a Mac (possibly hidden until moused over)?  Qt by default does the same.  From Qt6 docs: "Qt detects menu bars and turns them into Mac native menu bars".

Edward K. Ream

unread,
May 15, 2024, 12:31:44 PM5/15/24
to leo-editor
On Wednesday, May 15, 2024 at 11:22:18 AM UTC-5 Thomas wrote:

The TypeError message is from the spellchecker. 

Correct. #3912 is the issue and PR #3913 contains the proposed fix.

@andyjim The fix is just two lines of code. If you're willing you could make the changes "by hand" and report whether that fixes the crash.

Edward

andyjim

unread,
May 15, 2024, 7:55:42 PM5/15/24
to leo-editor
OK, in Mac the menu bar is at top of screen, not in the Leo window. True of all apps in Mac, I just wasn't expecting that in Leo and was looking for it in the Leo window. So that little glitch is solved and I'll continue getting acquainted.

On Wednesday, May 15, 2024 at 11:23:14 AM UTC-4 andyjim wrote:

Thomas Passin

unread,
May 15, 2024, 9:20:40 PM5/15/24
to leo-editor
It's something Qt on the Mac does automatically.  You have to go to some trouble to prevent it.

andyjim

unread,
May 16, 2024, 11:04:15 PM5/16/24
to leo-editor
one more question and I'll try to leave you alone:
I use Bike, an outlining editor. The file extension is .bike
Can I represent an external Bike file in a Leo outline and from that Leo outline can I open the external file in the Bike application? 

Thomas Passin

unread,
May 16, 2024, 11:52:25 PM5/16/24
to leo-editor
On Thursday, May 16, 2024 at 11:04:15 PM UTC-4 andyjim wrote:
one more question and I'll try to leave you alone:
I use Bike, an outlining editor. The file extension is .bike
Can I represent an external Bike file in a Leo outline and from that Leo outline can I open the external file in the Bike application? 
 
I don't know anything about a Bile file.  In general, if you can run Bike and get it to pen a file from the command line, we can easily issue that command from within Leo.  I see that a Bike outline is an html file. I don't know where they keep their images, etc, but it's not hard to display an html file in Leo.  Editing it is something else, though. I see that Bike also has an OPML format too.  OPML is a XML file but has a bad design for interchanging anything complicated.  In theory, an XSLT transformation could be written to convert it into a Leo file.  It's been so long since I worked on XSLT transformations (about 20 years) that I'm awfully rusty. There's also said to be a text format for Bike but I don't know anything about that.

So the answer might be that it can probably be done, but you might not be able to do the kind of editing of rich text that you can apparently do in Bike.  OTOH, Leo could be made to use a rich text editor instead of the plain text-based one it normally uses.  There's at least one plugin that does that, though I don't know if it still works.

Anyway, the answer to the question of representing an external Bike file in Leo is "probably yes, depending on what you want to do with it in Leo".

Reading a little more (Bike: An Elegant Outliner For Mac-Focused Workflows), it looks like it's an elegant riff off of Dave Winer's MORE outliner.  Surprise, so is Leo!  Dave strikes again.  And OPML is a data format from ... Dave.  Or it could be more reminiscent of Radio Userland, another Dave Winer project.  Anyone else remember Radio Userland?

lewis

unread,
May 17, 2024, 6:10:09 AM5/17/24
to leo-editor
It may be worth looking at the leoOPML plugin which allows Leo to read and write OPML files.
Reply all
Reply to author
Forward
0 new messages