Python 3 on MacOS

40 views
Skip to first unread message

Israel Hands

unread,
Sep 14, 2020, 1:12:05 PM9/14/20
to leo-editor
I have 2.7 and 3.7 installed but I can't get Leo to run under Python 3. If I type python3 at the command line it fires up. If I type python3 launch.leo I get ...(see below)
I changed the first line of launchleo.py to
#!/usr/bin/env python3

But that didn't help!  Ta like IH

Error in sitecustomize; set PYTHONVERBOSE for traceback:

AttributeError: module 'enum' has no attribute 'IntFlag'

Traceback (most recent call last):

  File "launchleo.py", line 7, in <module>

    import leo.core.runLeo

  File "/Applications/leo-editor-git/leo-editor/leo/core/runLeo.py", line 24, in <module>

    import leo.core.leoGlobals as leoGlobals

  File "/Applications/leo-editor-git/leo-editor/leo/core/leoGlobals.py", line 49, in <module>

    import gettext

  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gettext.py", line 49, in <module>

    import locale

  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/locale.py", line 16, in <module>

    import re

  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 143, in <module>

    class RegexFlag(enum.IntFlag):

AttributeError: module 'enum' has no attribute 'IntFlag'


Thomas Passin

unread,
Sep 14, 2020, 1:36:06 PM9/14/20
to leo-editor
This seems to be something wrong about your Python installation, not Leo.  My Python 3.8 installation in Windows has the exact same line at the same line number (class RegexFlag(enum.IntFlag):) and it works for me. 

You could check this as follows:

1. Open a Python3 session.
2. Type the following:

import enum
enum.IntFlag

You should see

<enum 'IntFlag'>

If you get some kind of an error, you will know for sure it's a problem with your installation.

Edward K. Ream

unread,
Sep 14, 2020, 3:02:57 PM9/14/20
to leo-editor
On Mon, Sep 14, 2020 at 12:12 PM Israel Hands <alis...@mcgh.ee> wrote:
I have 2.7 and 3.7 installed but I can't get Leo to run under Python 3.

Heh. I'm having trouble installing python3 and qt on MacOS Catalina.

Whenever you get a weird error, it's good to develop the habit of googling it.

Googling "module 'enum' has no attribute 'IntFlag'" should help. The first hit might be all you need.

HTH.

Edward





--
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/49050b66-9c3a-4b41-bdc1-6cc7db219a0en%40googlegroups.com.


--
-----------------------------------------------------------------
Edward K. Ream: edre...@gmail.com
An old man, crazy about computer programming.
-----------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages