[error] under m1 chip's macOS 12.3.1 with homebrew

1,160 views
Skip to first unread message

Zoom.Quiet

unread,
May 6, 2022, 12:01:59 PM5/6/22
to leo-e...@googlegroups.com
in the old MBP i install Leo flow
Installing Leo — Leo 6.6.1 documentation
https://leoeditor.com/installing.html#installing-leo-with-pip
(in fact "Installing Leo on MacOs 10.7 (Lion) and later¶" chapter is my logging)

after upgrade into M1max MBP and macOS 12.3.1, some thing is change;
i tried:
- PyENV, can not complile python 3.10.*
- Anaconda, can create py3.10 env, but can usage pip install Leo
- ...

so try install the lasted Leo with Homebrew Python

༄ abrew info pyt...@3.10
pyt...@3.10: stable 3.10.4 (bottled) [keg-only]
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/opt/homebrew/Cellar/pyt...@3.10/3.10.4 (3,165 files, 57.7MB)
Poured from bottle on 2022-05-06 at 12:16:44
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pyt...@3.10.rb
License: Python-2.0
==> Dependencies
Build: pkg-config ✔
Required: gdbm ✔, mpdecimal ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔
==> Caveats
Python has been installed as
/opt/homebrew/opt/pyt...@3.10/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
/opt/homebrew/opt/pyt...@3.10/libexec/bin

You can install Python packages with
/opt/homebrew/opt/pyt...@3.10/bin/pip3 install <package>
They will install into the site-package directory
/opt/homebrew/lib/python3.10/site-packages

tkinter is no longer included with this formula, but it is available separately:
brew install pyth...@3.10

See: https://docs.brew.sh/Homebrew-and-Python

pyt...@3.10 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have pyt...@3.10 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/pyt...@3.10/bin:$PATH"' >>
/Users/zoomq/.bash_profile

For compilers to find pyt...@3.10 you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/pyt...@3.10/lib"

For pkg-config to find pyt...@3.10 you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/pyt...@3.10/lib/pkgconfig"

==> Analytics
install: 327,625 (30 days), 1,043,942 (90 days), 2,203,047 (365 days)
install-on-request: 78,597 (30 days), 260,440 (90 days), 359,785 (365 days)
build-error: 328 (30 days)

but when i try pip install leo:

༄ pip install leo
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting leo
Downloading https://mirrors.aliyun.com/pypi/packages/52/d5/3e0b42cd0a41046ba583ea9e04dcc0e4b7d6454d5d41ce9cf1350f360800/leo-6.6.1-py3-none-any.whl
(13.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 MB 2.0 MB/s eta 0:00:00
Collecting PyQtWebEngine
Downloading https://mirrors.aliyun.com/pypi/packages/60/66/56e118abb4cddd8e4bea6f89bdec834069b52479fb991748f1b21950811e/PyQtWebEngine-5.15.5.tar.gz
(48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.6/48.6 KB 1.7 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Querying qmake about your Qt installation...
/opt/homebrew/bin/qmake -query
These bindings will be built: QtWebEngineCore, QtWebEngine,
QtWebEngineWidgets.
Generating the QtWebEngineCore bindings...
_in_process.py:
/private/var/folders/pl/8rsjzmjn2ybgd71lwqf3lxw80000gp/T/pip-install-2ob2v5nn/pyqtwebengine_bbfdebdd8f894252872cafbbe5a825b3/sip/QtWebEngineCore/QtWebEngineCoremod.sip:
line 25 column 9: 'QtCore/QtCoremod.sip' could not be found
/private/var/folders/pl/8rsjzmjn2ybgd71lwqf3lxw80000gp/T/pip-install-2ob2v5nn/pyqtwebengine_bbfdebdd8f894252872cafbbe5a825b3/sip/QtWebEngineCore/QtWebEngineCoremod.sip:
line 26 column 9: 'QtGui/QtGuimod.sip' could not be found
/private/var/folders/pl/8rsjzmjn2ybgd71lwqf3lxw80000gp/T/pip-install-2ob2v5nn/pyqtwebengine_bbfdebdd8f894252872cafbbe5a825b3/sip/QtWebEngineCore/QtWebEngineCoremod.sip:
line 27 column 9: 'QtNetwork/QtNetworkmod.sip' could not be found
/private/var/folders/pl/8rsjzmjn2ybgd71lwqf3lxw80000gp/T/pip-install-2ob2v5nn/pyqtwebengine_bbfdebdd8f894252872cafbbe5a825b3/sip/QtWebEngineCore/qwebengineclientcertificatestore.sip:
line 24 column 6: 'PyQt_SSL' is not a known qualifier
[end of output]

note: This error originates from a subprocess, and is likely not a
problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

how to fix it ?



----------------
life is pathetic, go Pythonic. 人生苦短, Python当歌 ;-)
课: https://py.101.camp/
怼: https://du.101.camp/
俺: http://zoomquiet.io
许: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦.
KM keep growing environment culture which promoting organization learning ;-)
zshot 2022-05-06 19.59.53.jpg

Zoom.Quiet

unread,
May 6, 2022, 12:05:23 PM5/6/22
to leo-e...@googlegroups.com
BTW:
install steps is:
0: base ARM version Homebrew install Pyt...@3.10
1: usage it create venv
༄ python3.10 -m venv .py310leo
2: activate it
༄ source .py310leo/bin/activate
3: base pip install Leo

༄ pip install leo

Zoom.Quiet <zoom....@gmail.com> 于2022年5月6日周五 20:01写道:
--

tbp1...@gmail.com

unread,
May 6, 2022, 12:51:32 PM5/6/22
to leo-editor
this looks like a problem with Qt or PyQt, not leo per se. possibilities:

- try to install PyQt6 on its own (without the rest of leo);
- try to install an earlier version of PyQt6, if you can figure out which ones are available;
- try installing PyQt5 instead of PyQt6 (Leo can use either one); 
- install python 3.9 and see whether PyQt6 or PyQt5 will install without errors.

Edward K. Ream

unread,
May 6, 2022, 2:14:30 PM5/6/22
to leo-editor
On Fri, May 6, 2022 at 7:51 AM tbp1...@gmail.com <tbp1...@gmail.com> wrote:
this looks like a problem with Qt or PyQt, not leo per se. possibilities:

- try to install PyQt6 on its own (without the rest of leo);
- try to install an earlier version of PyQt6, if you can figure out which ones are available;
- try installing PyQt5 instead of PyQt6 (Leo can use either one); 
- install python 3.9 and see whether PyQt6 or PyQt5 will install without errors.

Sounds like good advice.  Thanks.

Edward

Zoom.Quiet

unread,
May 7, 2022, 12:42:39 AM5/7/22
to leo-e...@googlegroups.com
Edward K. Ream <edre...@gmail.com> 于2022年5月6日周五 22:14写道:
sure, i will try them all.

> 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/CAMF8tS31%2BTiJRNNZzxJk1EDQKeXEKfMMdXY2ssAGbnF1BNSqRA%40mail.gmail.com.

Zoom.Quiet

unread,
May 27, 2022, 4:52:47 PM5/27/22
to leo-e...@googlegroups.com
Zoom.Quiet <zoom....@gmail.com> 于2022年5月7日周六 08:42写道:
>
> Edward K. Ream <edre...@gmail.com> 于2022年5月6日周五 22:14写道:
> >
> > On Fri, May 6, 2022 at 7:51 AM tbp1...@gmail.com <tbp1...@gmail.com> wrote:
> >>
> >> this looks like a problem with Qt or PyQt, not leo per se. possibilities:
> >>
> >> - try to install PyQt6 on its own (without the rest of leo);
> >> - try to install an earlier version of PyQt6, if you can figure out which ones are available;
> >> - try installing PyQt5 instead of PyQt6 (Leo can use either one);
> >> - install python 3.9 and see whether PyQt6 or PyQt5 will install without errors.
> >
> >
> > Sounds like good advice. Thanks.
> >
> sure, i will try them all.
>
my macOS is transform old macOS 10.12 into M1 chip macOS 12.*
i guess old python env. is compiled by intel chip,
and new env. base arm chip, so everything is chaos;

so try some time, find can work way:

+ base new arm homebrew install miniconda
+ usage this conda env, create py 3.8.11
+ and also base abrew(brew for arm chip) install qt@5 pyqt@5
+ copy all packet from hombrew into conda 's env, for me is:
/opt/homebrew/Cellar/pyqt@5/5.15.6/lib/python3.9/site-packages/
=>
/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/lib/python3.8/site-packages/

for now leo can install succeed
all installed packets is:

$ pip list
Package Version
----------------------------- -----------
alabaster 0.7.12
astroid 2.11.5
attrs 21.4.0
Babel 2.10.1
beautifulsoup4 4.11.1
bs4 0.0.1
certifi 2020.6.20
charset-normalizer 2.0.12
commonmark 0.9.1
dialite 0.5.3
dill 0.3.5.1
docutils 0.17.1
fastjsonschema 2.15.3
flexx 0.8.4
future 0.18.2
idna 3.3
imagesize 1.3.0
importlib-metadata 4.11.4
importlib-resources 5.7.1
isort 5.10.1
Jinja2 3.1.2
jsonschema 4.5.1
jupyter-core 4.10.0
lazy-object-proxy 1.7.1
leo 5.9
MarkupSafe 2.1.1
mccabe 0.7.0
nbformat 5.4.0
packaging 21.3
pip 21.2.4
pip-search 0.0.12
platformdirs 2.5.2
pscript 0.7.7
pyflakes 2.4.0
Pygments 2.12.0
pylint 2.13.9
pyparsing 3.0.9
PyQt3D 5.15.5
PyQt5 5.15.6
PyQt5-sip 12.9.0
PyQtChart 5.15.5
PyQtDataVisualization 5.15.5
PyQtNetworkAuth 5.15.5
PyQtPurchasing 5.15.5
pyrsistent 0.18.1
pytz 2022.1
requests 2.27.1
rich 12.4.4
setuptools 61.2.0
six 1.16.0
snowballstemmer 2.2.0
soupsieve 2.3.2.post1
Sphinx 4.5.0
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
tomli 2.0.1
tornado 6.1
traitlets 5.2.1.post0
typing_extensions 4.2.0
urllib3 1.26.9
webruntime 0.5.8
wheel 0.37.1
wrapt 1.14.1
zipp 3.8.0



but when i try run leo under this env, is error:

༄ leo
leoQt.py: can not fully import PyQt5.
Traceback (most recent call last):

File "/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/lib/python3.8/site-packages/leo/core/leoQt.py",
line 55, in <module>
from PyQt5 import QtCore

ModuleNotFoundError: No module named 'PyQt5.sip'


Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/bin/leo",
line 5, in <module>
from leo.core.runLeo import run
File "/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/lib/python3.8/site-packages/leo/core/runLeo.py",
line 27, in <module>
leoGlobals.app = leoApp.LeoApp()
File "/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/lib/python3.8/site-packages/leo/core/leoApp.py",
line 334, in __init__
import leo.core.leoFrame as leoFrame
File "/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/lib/python3.8/site-packages/leo/core/leoFrame.py",
line 13, in <module>
import leo.core.leoColorizer as leoColorizer
File "/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/lib/python3.8/site-packages/leo/core/leoColorizer.py",
line 18, in <module>
from leo.core.leoQt import Qsci, QtGui, QtWidgets
File "/opt/homebrew/Caskroom/miniconda/base/envs/leo3811/lib/python3.8/site-packages/leo/core/leoQt.py",
line 88, in <module>
qt_version = QtCore.QT_VERSION_STR
NameError: name 'QtCore' is not defined

what i miss?


> > Edward

Zoom.Quiet

unread,
May 27, 2022, 5:04:03 PM5/27/22
to leo-e...@googlegroups.com
Zoom.Quiet <zoom....@gmail.com> 于2022年5月28日周六 00:52写道:
appended, i try base py 3.9.11 env re-install leo is ok,
but when run, is diff error:

༼conda: py396༽~༽
༄ leo
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/py396/bin/leo",
line 8, in <module>
sys.exit(run())
File "/opt/homebrew/Caskroom/miniconda/base/envs/py396/lib/python3.9/site-packages/leo/core/runLeo.py",
line 72, in run
g.app.loadManager.load(fileName, pymacs)
File "/opt/homebrew/Caskroom/miniconda/base/envs/py396/lib/python3.9/site-packages/leo/core/leoApp.py",
line 2252, in load
t1 = time.clock()
AttributeError: module 'time' has no attribute 'clock'

Zoom.Quiet

unread,
May 27, 2022, 5:25:07 PM5/27/22
to leo-e...@googlegroups.com
fixed, i guess the pip install leo auto install old verion,
so i download lasted leo and base conda env. call launchLeo.py, and
working now ;-)
later, i will write the M1 chip macOS install Leo handbook...

༼conda: py396༽~༽
༄ python /opt/bin/leo/launchLeo.py

setting leoID from os.getenv('USER'): 'zoomq'
PYLINTHOME is now '/Users/zoomq/Library/Caches/pylint' but obsolescent
'/Users/zoomq/.pylint.d' is found; you can safely remove the latter
duplicate, (not conflicting) key bindings in myLeoSettings.leo
all Alt+) move-past-close
all Alt+) move-past-close
duplicate, (not conflicting) key bindings in myLeoSettings.leo
all Alt+} forward-paragraph
all Alt+} forward-paragraph-extend-selection
duplicate, (not conflicting) key bindings in myLeoSettings.leo
all Ctrl+( add-comments
all Ctrl+( add-comments
duplicate, (not conflicting) key bindings in myLeoSettings.leo
all Ctrl+) delete-comments
all Ctrl+) delete-comments
all Ctrl+) delete-comments
duplicate, (not conflicting) key bindings in myLeoSettings.leo
all Ctrl+{ promote
all Ctrl+{ promote
duplicate, (not conflicting) key bindings in myLeoSettings.leo
all Ctrl+} demote
all Ctrl+} demote
Leo 6.6.2
Python 3.9.6, PyQt version 5.15.3
darwin
expand_css_constants Unresolved @constants
[
'@bookmarks_base_decoration',
'@bookmarks_children_family',
'@bookmarks_base_border',
'@bookmarks_base_family',
'@checkbox-font-family',
'@dialog-font-family',
'@dialog-font-weight',
'@status-font-family',
'@dialog-font-style',
'@dialog-font-size'
]
qt.qpa.fonts: Populating font family aliases took 127 ms. Replace uses
of missing font family "Monoid Retina" with one that exists to avoid
this cost.
not found: '@auto 4py3ch.md'
not found: '@auto 4py4ch.md'
not found: '@auto 4py5ch.md'
not found: '@auto 4py6ch.md'
not found: '@auto 4pyend.md'
not found: /Users/zoomq/Sites/101.camp/utility/announcer/tasks.py
not found: /Users/zoomq/Sites/101.camp/utility/pol/camp.yaml
not found: /Users/zoomq/Sites/101.camp/utility/pol/st.py
not found: /Users/zoomq/Sites/101.camp/utility/pol/tasks.py
not found: /Users/zoomq/Sites/101.camp/utility/pow/tasks.py
not found: /Users/zoomq/Sites/101.camp/_course/101camp1py/pow/tasks.py
expand_css_constants Unresolved @constants
[
'@bookmarks_base_decoration',
'@bookmarks_children_family',
'@bookmarks_base_border',
'@bookmarks_base_family',
'@checkbox-font-family',
'@dialog-font-family',
'@dialog-font-weight',
'@status-font-family',
'@dialog-font-style',
'@dialog-font-size'
]
expand_css_constants Unresolved @constants
[
'@bookmarks_base_decoration',
'@bookmarks_children_family',
'@bookmarks_base_border',
'@bookmarks_base_family',
'@checkbox-font-family',
'@dialog-font-family',
'@dialog-font-weight',
'@status-font-family',
'@dialog-font-style',
'@dialog-font-size'
]
wrote /Users/zoomq/.leo/leo.session
wrote recent file: /Users/zoomq/.leo/.leoRecentFiles.txt


Zoom.Quiet <zoom....@gmail.com> 于2022年5月28日周六 01:03写道:
zshot 2022-05-28 01.23.08.jpg

Edward K. Ream

unread,
May 27, 2022, 10:04:02 PM5/27/22
to leo-editor
On Fri, May 27, 2022 at 12:25 PM Zoom.Quiet <zoom....@gmail.com> wrote:
fixed, i guess the pip install leo auto install old verion,
so i download lasted leo and base conda env. call launchLeo.py, and
working now ;-)
later, i will write the M1 chip macOS install Leo handbook...

Many thanks for your testing.

There are no calls to time.clock in Leo's core. time.clock was removed in Python 3.8.

Edward

Zoom.Quiet

unread,
May 28, 2022, 2:00:23 AM5/28/22
to leo-e...@googlegroups.com
Edward K. Ream <edre...@gmail.com> 于2022年5月28日周六 06:04写道:
Yea, base this, i guess E.K.R must not miss this,
the error must in old version,
but in miniconda env. auto installed too old Leo;
so change call leo base download packet,
everything is right now ;-)


> 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/CAMF8tS07ZagmiLk_vsKPoTNU1rfQz4%2B51WvEydvjEAusO_ikDg%40mail.gmail.com.

Edward K. Ream

unread,
May 28, 2022, 9:59:52 AM5/28/22
to leo-editor
On Fri, May 27, 2022 at 9:00 PM Zoom.Quiet <zoom....@gmail.com> wrote:

> There are no calls to time.clock in Leo's core. time.clock was removed in Python 3.8.


Yea, base this, i guess E.K.R must not miss this,
the error must in old version,
but in miniconda env. auto installed too old Leo;
so change call leo base download packet,
everything is right now ;-)

Glad to hear it. Keep up your testing!

Edward

Zoom.Quiet

unread,
May 29, 2022, 3:35:43 PM5/29/22
to leo-e...@googlegroups.com
try others way, but all failed,
so publish as blog as:
How to install Leo under M1 chip macOS 12.* / 是也乎( ̄▽ ̄) / ZoomQuiet.io
https://blog.zoomquiet.io/leo-install-m1mac-summary.html

markdown raw is :
https://raw.githubusercontent.com/ZoomQuiet/ZoomQuiet.io/master/content/Pythonic/leo-install-m1mac-summary.md

support append for Installing Leo — Leo 6.6.2 documentation
http://leoeditor.com/installing.html#installing-leo-on-macos-10-7-lion-and-later

Edward K. Ream <edre...@gmail.com> 于2022年5月28日周六 17:59写道:
> --
> 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/CAMF8tS3j8oaU2AyfVxca_WgWxU7u9_fHSweQ9P3L%2BxLaJof%3D%2Bw%40mail.gmail.com.

Edward K. Ream

unread,
May 29, 2022, 5:42:36 PM5/29/22
to leo-editor
On Sun, May 29, 2022 at 10:35 AM Zoom.Quiet <zoom....@gmail.com> wrote:
try others way, but all failed,
so publish as blog as:
How to install Leo under M1 chip macOS 12.* / 是也乎( ̄▽ ̄) / ZoomQuiet.io
https://blog.zoomquiet.io/leo-install-m1mac-summary.html

Many thanks for this documentation!

Edward
Reply all
Reply to author
Forward
0 new messages