Leo 6.0 requires Python 3.6 or later

57 views
Skip to first unread message

Edward K. Ream

unread,
Jun 20, 2019, 10:08:23 AM6/20/19
to leo-editor
Nobody has complained about this, so I assume everyone has already gotten the message.

I am not willing to support python 3.5 or earlier.  Imo, the early versions of python 3 were dogs.

Details

The startup code uses g.minimum_python_version (The string '3.6') and raises an emergency (tkinter) dialog if the python version is too low.  Leo raises another emergency dialog if Qt is not available.

I have just removed all references to python 2 in LeoDocs.leo, emphasizing instead that python 3.6 or later is required.

Edward

Rob

unread,
Jun 20, 2019, 11:58:21 AM6/20/19
to leo-editor
Now I can't run Leo at all.
  1. Had Python 3.4 on Windows (Leo worked fine).
  2. Updated latest Git version of Leo as usual.
  3. After error attempting to launch Leo (needs Python 3.6 or above), I installed Anaconda 64 bit. This includes Python 3.7 and PyQt5 by default.
  4. Set path in batch script to python.exe where Anaconda put it (ProgramData).
  5. Leo won't launch. I get a brief console screen, then nothing; no errors to report or other clues on how to proceed.
Any ideas on what to try next?

Rob...

Edward K. Ream

unread,
Jun 20, 2019, 12:08:36 PM6/20/19
to leo-editor
On Thu, Jun 20, 2019 at 10:58 AM Rob <lar...@gmail.com> wrote:
Now I can't run Leo at all.
 
Any ideas on what to try next?

Open a console first.  Then run python from the console.  That way the console will remain open and you can see what went wrong.

Edward

Rob

unread,
Jun 20, 2019, 1:04:36 PM6/20/19
to leo-editor
PS D:\Synced\github repos\leo> c:\ProgramData\Anaconda3\python.exe launchLeo.py
Traceback (most recent call last):
  File "launchLeo.py", line 7, in <module>
    import leo.core.runLeo
  File "D:\Synced\github repos\leo\leo\core\runLeo.py", line 27, in <module>
    import leo.core.leoApp as leoApp
  File "D:\Synced\github repos\leo\leo\core\leoApp.py", line 22, in <module>
    import sqlite3
  File "C:\ProgramData\Anaconda3\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "C:\ProgramData\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.

I verified that the last file mentioned: "C:\ProgramData\Anaconda3\lib\sqlite3\dbapi2.py" exists. What does 'DLL load failed...' mean?

Rob...

Terry Brown

unread,
Jun 20, 2019, 1:22:19 PM6/20/19
to Leo list
I think activating an Anaconda environment requires more steps.  Easiest way for testing is to launch the Anaconda shell from the start menu.

If your ultimate goal is launching from an icon there are more steps, but initial testing the shell's the way to go.

Cheers -Terry


--
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 post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/b556f104-7c41-4b5a-b8fb-c18070ba0697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob

unread,
Jun 20, 2019, 1:34:06 PM6/20/19
to leo-editor
Thanks, Terry. I was able to launch Leo from an Anaconda shell. How do I translate that to a Windows shortcut like I had before?

Rob...
To unsubscribe from this group and stop receiving emails from it, send an email to leo-e...@googlegroups.com.

Terry Brown

unread,
Jun 20, 2019, 2:01:52 PM6/20/19
to Leo list
Looks like you'd need something along these lines:  https://stackoverflow.com/questions/42602024/windows-shortcut-to-run-python-script-in-anaconda-command-prompt

replacing "jupyter lab" with "python c:\some\path\to\launchLeo.py".

Not knowing your skill set let me know if more detail woudl be helpful :)

Cheers -Terry
> To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.

> To post to this group, send email to leo-e...@googlegroups.com.
> Visit this group at https://groups.google.com/group/leo-editor.

Rob

unread,
Jun 20, 2019, 3:19:11 PM6/20/19
to leo-editor
Doesn't work, perhaps I'm not understanding something.
  1. I created an Anaconda environment (leo) which includes Python 3.7 and PyQt (among other things).
  2. I created the following batch file (paths match my file paths).
echo off

CALL  C:\ProgramData\Anaconda3\Scripts\activate.bat C:\Users\rob_iawac46\.conda\envs\leo python "D:\Synced\github repos\leo\launchLeo.py"

echo on

I even tried with echo on to see if I could see what was going on. No luck. Also tried the string after python w/o the double-quotes; doesn't work either.

Rob...

Terry Brown

unread,
Jun 20, 2019, 3:58:56 PM6/20/19
to leo-e...@googlegroups.com
On Thu, 20 Jun 2019 12:19:10 -0700 (PDT)
Rob <lar...@gmail.com> wrote:

> Doesn't work, perhaps I'm not understanding something.
>
> 1. I created an Anaconda environment (leo) which includes Python
> 3.7 and PyQt (among other things).
> 2. I created the following batch file (paths match my file paths).
>
> echo off
>
> CALL C:\ProgramData\Anaconda3\Scripts\activate.bat
> C:\Users\rob_iawac46\.conda\envs\leo python "D:\Synced\github
> repos\leo\launchLeo.py"

CALL C:\ProgramData\Anaconda3\Scripts\activate.bat C:\Users\rob_iawac46\.conda\envs\leo

python "D:\Synced\github repos\leo\launchLeo.py"

the way the web page I linked to was formatted made it hard to tell
whether there was a line-break there or not, but I think there should
be.

If that doesn't work open a regular cmd shell window, cd to the folder
where the above batch file is, and run the batch file by typing its
name, hopefully that will preserve any useful feedback.

Cheers -Terry
> > an email to leo-e...@googlegroups.com <javascript:>.
> > > To post to this group, send email to leo-e...@googlegroups.com
> > <javascript:>.
> > > Visit this group at https://groups.google.com/group/leo-editor.
> > > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/leo-editor/0d5b19b5-6818-45f2-b31c-c9acc731a35c%40googlegroups.com
> > .

Rob

unread,
Jun 20, 2019, 4:26:53 PM6/20/19
to leo-editor
Needs to be on the same line. However, I get this error:

D:\Utility Apps\Leo Resources>echo off
activate does not accept more than one argument:
['C:\\Users\\rob_iawac46\\.conda\\envs\\leo', 'python', 'D:\\Synced\\github repos\\leo\\launchLeo.py']

Looks like I can't pass the script file as an argument to the python command, which is itself an argument.

Rob...

Terry Brown

unread,
Jun 20, 2019, 4:49:21 PM6/20/19
to leo-e...@googlegroups.com
On Thu, 20 Jun 2019 13:26:53 -0700 (PDT)
Rob <lar...@gmail.com> wrote:

> Needs to be on the same line. However, I get this error:

I just tested it and it worked for me using two lines.

Here's my exact leo.bat:



call c:\Users\TBrown02\local\mc2\Scripts\activate.bat c:\Users\TBrown02\local\mc2\envs\leo

python c:\Users\TBrown02\Desktop\leo-editor-devel\launchLeo.py




In the above c:\Users\TBrown02\local\mc2 is equivalent to your
C:\Users\rob_iawac46\.conda

Cheers -Terry

Rob

unread,
Jun 20, 2019, 6:23:29 PM6/20/19
to leo-editor
I was breaking the line at a different place. Now it works following your example. However, it doesn't accept Leo command line arguments, but for now let's leave it at that and perhaps I'll start a new thread on that subject. Thanks for your help!

Rob...

Matt Wilkie

unread,
Jul 7, 2019, 8:45:34 PM7/7/19
to leo-editor
Rob it sounds like you may have solved your problem, but here's something for future reference, and anyone who dumps into this thread following a search:

  1. install python 3.6+ (miniconda and anaconda are good routes)
  2. fetch latest Leo git sources however you usually do (`git clone ....`)
  3. run `pip install --editable c:\path\to\leo-editor` from a command shell where python.exe works (e.g. Anaconda Command Prompt)

Now Leo can be run with command `leo` (gui only) or `leo-messages` (gui with console messages) from any command shell where that python.exe is available. The two are functionally identical to `pythonw c:\path\to\leo-editor\launchLeo.py` and `python c:\path\to\leo-editor\launchLeo.py` respectively. No batch files needed! :)

4.  For desktop integration use one of the recipes in #1012 comment Feb-27 to run leo\scripts\win-register-leo.leox.  "From Leo GUI" is the most tested.

-matt
Reply all
Reply to author
Forward
0 new messages