Is there any user-friendly installer for Leo?

57 views
Skip to first unread message

Iohannes

unread,
Apr 19, 2020, 9:30:03 AM4/19/20
to leo-editor
Hi, beginner here.

I would like to ask you - is there any user-friendly installer for Leo?
I am using Windows and the old version Leo_5.3-b1_Win that I downloaded as a simple .zip, works fine but I am not able to install the latest version. :(
I have Anaconda - and pip failed.
I downloaded the version from GitHub and install it from power-shell with pip, it failed also.
I am not sure what I could do more.

Best!
Iohannes


Viktor Ransmayr

unread,
Apr 19, 2020, 10:27:28 AM4/19/20
to leo-e...@googlegroups.com
Hello Iohannes,

Am So., 19. Apr. 2020 um 15:30 Uhr schrieb Iohannes <jan.ods...@gmail.com>:
Hi, beginner here.

I would like to ask you - is there any user-friendly installer for Leo?

I'm not aware of any Windows-specific installer for Leo at least since version 6.0.

I am using Windows and the old version Leo_5.3-b1_Win that I downloaded as a simple .zip, works fine but I am not able to install the latest version. :(
I have Anaconda - and pip failed.

With what error is your pip installation failing?

The way that I set up Leo on Windows, is to create a dedicated Python virtual environment & to install Leo from PyPI using pip into it ...

This is the recipe that works for me on Windows 10 using PowerShell w/o any problems:

PS C:\Users\viktor> mkdir PyVE\PyPI
PS C:\Users\viktor> cd PyVE\PyPI
PS C:\Users\viktor\PyVE\PyPI> python -m venv Leo
PS C:\Users\viktor\PyVE\PyPI> cd Leo
PS C:\Users\viktor\PyVE\PyPI\Leo> .\scripts\activate.ps1
PS C:\Users\viktor\PyVE\PyPI\Leo> pip install leo
PS C:\Users\viktor\PyVE\PyPI\Leo> leo --use-docks

I downloaded the version from GitHub and install it from power-shell with pip, it failed also.

With kind regards,

Viktor

Iohannes

unread,
Apr 19, 2020, 11:24:04 AM4/19/20
to leo-editor
Dear Viktor,

thank you very much for your answer! I have followed your instruction. After some struggle (I had to change the maximal lenght of PATH of the filesystem), I have been able to install it. Yet, the last command gives me an error:

PS C:\Users\HOMEDIR\PyVE\PyPI\Leo> leo --use-docks
leo
: The term 'leo' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name
, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ leo --use-docks
+ ~~~
   
+ CategoryInfo          : ObjectNotFound: (leo:String) [], CommandNotFoundException
   
+ FullyQualifiedErrorId : CommandNotFoundException

After the change of the maximal path in the filesystem, I have been also able to install leo in Anaconda Prompt (not possible before).
However, it does not run.
The error I get is:
Enter code here...(base) C:\Users\HOMEDIR>python
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import leo
>>> leo.run()
leoQt
.py: can not fully import PyQt5.
Traceback (most recent call last):

 
File "C:\Users\HOMEDIR\AppData\Roaming\Python\Python37\site-packages\leo\core\leoQt.py", line 52, in <module>
   
from PyQt5 import QtCore

ModuleNotFoundError: No module named 'PyQt5.sip'


Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
 
File "C:\Users\HOMEDIR\AppData\Roaming\Python\Python37\site-packages\leo\__init__.py", line 10, in run
   
import leo.core.runLeo as runLeo
 
File "C:\Users\HOMEDIR\AppData\Roaming\Python\Python37\site-packages\leo\core\runLeo.py", line 25, in <module>
    g
.app = leoApp.LeoApp()
 
File "C:\Users\HOMEDIR\AppData\Roaming\Python\Python37\site-packages\leo\core\leoApp.py", line 338, in __init__
   
import leo.core.leoFrame as leoFrame
 
File "C:\Users\HOMEDIR\AppData\Roaming\Python\Python37\site-packages\leo\core\leoFrame.py", line 13, in <module>
   
import leo.core.leoColorizer as leoColorizer
 
File "C:\Users\HOMEDIR\AppData\Roaming\Python\Python37\site-packages\leo\core\leoColorizer.py", line 18, in <module>
   
from leo.core.leoQt import Qsci, QtGui, QtWidgets
 
File "C:\Users\HOMEDIR\AppData\Roaming\Python\Python37\site-packages\leo\core\leoQt.py", line 82, in <module>
    qt_version
= QtCore.QT_VERSION_STR
NameError: name 'QtCore' is not defined

Any suggestion?

Best regards,
Jan



On Sunday, 19 April 2020 16:27:28 UTC+2, Viktor Ransmayr wrote:
Hello Iohannes,

Matt Wilkie

unread,
Apr 19, 2020, 12:22:11 PM4/19/20
to leo-editor
Hello Jan,

The most solid way is to install from sources (https://leoeditor.com/installing.html#installing-leo-from-sources-all-platforms) but unfortunately it's not the friendliest route for non-comandline folk.

Overview:

1. Install python (v3.6+)
2. Download Leo sources, and unpack somehwere convenient (e.g. c:\apps\leo-editor)
3. Install with pip from a python enabled command prompt :
pip install --editable c:\apps\leo-editor
4. Run leo.

From your reported errors step 3 wasn't run or something went wrong with it (the dependent library PyQt5 wasn't installed, and probably others).

Anaconda specific for Windows:

Start >> Anaconda Shell, then:

python --version
pip install
--editable c:\apps\leo-editor
leo
-messages

The Pip install part will output a lot of messages. Generally the first and last 10 lines or so are most useful for troubleshooting.

cheers,

-matt

Iohannes

unread,
Apr 19, 2020, 1:45:23 PM4/19/20
to leo-editor
Dear Matt and Viktor,

thank you very much for your help. I have tried everything I could but everything failed. Finally, I have decided to reinstall Python and the recommended installation process by Matt went smoothly :).
So maybe there was something wrong with my Python.

I have a couple of more question but I will make a separate post for them :). I guess it is better to do in that way.

Thank you very much again,
best
Jan

Viktor Ransmayr

unread,
Apr 19, 2020, 2:11:52 PM4/19/20
to leo-e...@googlegroups.com
Hello Jan,

Am So., 19. Apr. 2020 um 17:24 Uhr schrieb Iohannes <jan.ods...@gmail.com>:

thank you very much for your answer! I have followed your instruction. After some struggle (I had to change the maximal lenght of PATH of the filesystem), I have been able to install it. Yet, the last command gives me an error:

PS C:\Users\HOMEDIR\PyVE\PyPI\Leo> leo --use-docks
leo
: The term 'leo' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name
, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ leo --use-docks
+ ~~~
   
+ CategoryInfo          : ObjectNotFound: (leo:String) [], CommandNotFoundException
   
+ FullyQualifiedErrorId : CommandNotFoundException

...

Any suggestion?

What's the value of your PATH environment variable?

In other words: what does the following command in Powershell report for you, before you try 'leo --use-docks'?

PS C:\Users\viktor\PyVE\PyPI\Leo> $env:path

In my case it does report:

C:\Users\viktor\PyVE\PyPI\Leo\scripts;C:\Windows\system32; ...

as the very first entry. - This is where the file 'leo.exe' is found.

From what you report, it looks like a problem with your Python virtual environment!

With kind regards,

Viktor

tfer

unread,
Apr 19, 2020, 4:18:27 PM4/19/20
to leo-editor
Since you're using powershell, setting up the git repository to use scoop might be the simplest solution to this.  Of course that needs to be done by us so it would support scoop installs.

Tom

Thomas Passin

unread,
Apr 19, 2020, 6:41:39 PM4/19/20
to leo-e...@googlegroups.com
In order for the bare command leo to work, the operating system has to know that it's a Python file and that it's supposed to open a Python file using Python.  Sometimes this chain of identification doesn't get set up right.  It seems like that was the problem when you got this error message:

leo : The term 'leo' is not recognized as the name of a cmdlet, function, script file, or operable program.

It will not get set up if you just download a zip file and run from it.  A pip install *may* do it, but I'm not sure.

I always run Leo directly, like this:

py38 -m launchLeo --use-docks
# or
py38 -m leo.core.runLeo --use-docs

Here, py38 is my installed Python 3.8 executable, which should have been put on your PATH by the pip installer.  Actually, though, I made a batch file for it to make sure the system could find it.  I did it this way because my system thinks that "python" is my Python 2.7 installation instead.

Using the -m option tells Python to run the module (e.g., launchLeo.py), as long as it is in a location known to Python.  For a pip install, Python can always find the module.  You don't need to have the system path set up correctly, and you don't need to remember where Leo is located.

So that's what I like to do.

Matt Wilkie

unread,
Apr 19, 2020, 8:36:26 PM4/19/20
to leo-editor
thank you very much for your help. I have tried everything I could but everything failed. Finally, I have decided to reinstall Python and the recommended installation process by Matt went smoothly :).
So maybe there was something wrong with my Python.

You're welcome, and thanks for reporting back.
 
I have a couple of more question but I will make a separate post for them :). I guess it is better to do in that way.

Yes, it's definitely easier to track separate problems in different threads! Thanks.

-matt

Matt Wilkie

unread,
Apr 19, 2020, 8:37:38 PM4/19/20
to leo-editor
In order for the bare command leo to work, the operating system has to know that it's a Python file and that it's supposed to open a Python file using Python.  Sometimes this chain of identification doesn't get set up right.  It seems like that was the problem when you got this error message:

leo : The term 'leo' is not recognized as the name of a cmdlet, function, script file, or operable program.

It will not get set up if you just download a zip file and run from it.  A pip install *may* do it, but I'm not sure.
 
Yes, it will.

-matt

Thomas Passin

unread,
Apr 19, 2020, 9:59:54 PM4/19/20
to leo-editor
Well, look at that.  My stock Leo pip install, which is 5.9, does launch just by typing leo.  Of course, that's my old python 2.7/qt4 installation which I never run anymore.  I forget if I installed Leo with the installer or with pip for that one. 

My system path includes c:\Python27\Scripts.  That Scripts directory contains a leo.exe. When I installed Python 3.8, its location never got added to the system path.  I have a batch file that disables the python 2.7 path steps and adds the Python38/Scripts directory.  After I run it, then I have a leo command that launches Leo with the Python 3.8 setup.  I suppose I never discovered it because I normally launch from a console window, rather than using pythonw.

What's more, if I set PYTHONPATH to point to my git clone location, the leo command launches Leo from there instead of from the standard install.  Excellent - that's just what I would want.

OTOH, I don't see a leo.exe command in the Git clone.  I suppose that it gets built somewhere for the Leo wheel for Windows, is that right?

Matt Wilkie

unread,
Apr 20, 2020, 1:23:07 AM4/20/20
to leo-editor
 
What's more, if I set PYTHONPATH to point to my git clone location, the leo command launches Leo from there instead of from the standard install.  Excellent - that's just what I would want.

Cool, I didn't know that.

 
OTOH, I don't see a leo.exe command in the Git clone.  I suppose that it gets built somewhere for the Leo wheel for Windows, is that right?

Right, pip builds the wrappers in PYTHONHOME/Scripts at install time. It takes care of linking to the desired python interpreter in the right location (on Linux this means puting in the correct path in the shebang line).

leo.exe is the same as "pythonW.exe -m leo ..." and
"leo-messages.exe" is same as "python.exe -m leo ..." (no 'w').

-matt

Thomas Passin

unread,
Apr 20, 2020, 7:00:18 AM4/20/20
to leo-editor

On Monday, April 20, 2020 at 1:23:07 AM UTC-4, Matt Wilkie wrote:
 
What's more, if I set PYTHONPATH to point to my git clone location, the leo command launches Leo from there instead of from the standard install.  Excellent - that's just what I would want.

Cool, I didn't know that.

That's how I usually run Leo.  I don't bother with pip install -e.  I just set PYTHONPATH to the clone or zip location.  Of course, if I had never installed a version of Leo with pip, then I wouldn't have a copy of leo.exe, but that's all right with me.
Reply all
Reply to author
Forward
0 new messages