Has anyone succeeded at building Anki on MacOS Big Sur? The Macbook Pro is a Apple Silicon M1 system if that can help.
I think I am running into a case of QT5 blues although after googling like mad, I tried setting up flags and other hat tricks the build is still barfing on me.
Has anyone solved that QT5 building on Big Sur issue that’s a hard dependency in Anki app?
dae
August 29, 2021, 3:37am
2
It should work fine provided you run the x86 version of the tools. Homebrew may have started defaulting to arm, and if so, you’ll need to tell it to install the x86 versions instead.
Being doing as I’ve been told… However:
>
> Successfully built pyqt5 PyQt5-sip
> Installing collected packages: urllib3, soupsieve, six, pyrsistent, PyQt5-sip, idna, charset-normalizer, certifi, attrs, send2trash, requests, pyqt5, pyaudio, markdown, jsonschema, beautifulsoup4, aqt
> Running setup.py install for pyaudio ... error
> ERROR: Command errored out with exit status 1:
> command: /Users/lorenzo/pyenv/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-gyrnx9pk/pyaudio_fc642e01241f4153a99bc9eb95777008/setup.py'"'"'; __file__='"'"'/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-gyrnx9pk/pyaudio_fc642e01241f4153a99bc9eb95777008/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-record-5mzy3l0x/install-record.txt --single-version-externally-managed --compile --install-headers /Users/lorenzo/pyenv/include/site/python3.9/pyaudio
> cwd: /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-gyrnx9pk/pyaudio_fc642e01241f4153a99bc9eb95777008/
> Complete output (16 lines):
> running install
> running build
> running build_py
> creating build
> creating build/lib.macosx-11.2-arm64-3.9
> copying src/pyaudio.py -> build/lib.macosx-11.2-arm64-3.9
> running build_ext
> building '_portaudio' extension
> creating build/temp.macosx-11.2-arm64-3.9
> creating build/temp.macosx-11.2-arm64-3.9/src
> clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DMACOSX=1 -I/Users/lorenzo/pyenv/include -I/Users/lorenzo/.pyenv/versions/3.9.6/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-11.2-arm64-3.9/src/_portaudiomodule.o
> src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
> #include "portaudio.h"
> ^~~~~~~~~~~~~
> 1 error generated.
> error: command '/usr/bin/clang' failed with exit code 1
> ----------------------------------------
> ERROR: Command errored out with exit status 1: /Users/lorenzo/pyenv/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-gyrnx9pk/pyaudio_fc642e01241f4153a99bc9eb95777008/setup.py'"'"'; __file__='"'"'/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-gyrnx9pk/pyaudio_fc642e01241f4153a99bc9eb95777008/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-record-5mzy3l0x/install-record.txt --single-version-externally-managed --compile --install-headers /Users/lorenzo/pyenv/include/site/python3.9/pyaudio Check the logs for full command output.
➜ ~
I ran again into some issues: Installing portaudio with homebrew doesn’t seem to solve anything. It’s probably because it should be in the pyenv. Doing a
~/pyenv/bin/pip install portaudio
ERROR: Could not find a version that satisfies the requirement portaudio (from versions: none)
ERROR: No matching distribution found for portaudio
So I do:
**➜** **~** ~/pyenv/bin/pip install wheel
Collecting wheel
Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.0
And then:
**➜** **~** ~/pyenv/bin/pip install portaudio
ERROR: Could not find a version that satisfies the requirement portaudio (from versions: none)
ERROR: No matching distribution found for portaudio
**➜** **~**
Que merda!
Looks like pyaudio last rev is dated from 4 years ago.
http://people.csail.mit.edu/hubert/pyaudio/
Warning: portaudio 19.7.0 is already installed and up-to-date.
To reinstall 19.7.0, run:
brew reinstall portaudio
but the pip command fails:
> **
> ➜ ~ pip install pyaudio
> Collecting pyaudio
> Using cached PyAudio-0.2.11.tar.gz (37 kB)
> Building wheels for collected packages: pyaudio
> Building wheel for pyaudio (setup.py) … error
> ERROR: Command errored out with exit status 1:
> command: /Users/lorenzo/.pyenv/versions/3.9.6/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/setup.py’"’"’; file =’"’"’/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file ) if os.path.exists(file ) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file , ‘"’"‘exec’"’"’))’ bdist_wheel -d /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-wheel-ol0t0syb
> cwd: /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/
> Complete output (16 lines):
> running bdist_wheel
> running build
> running build_py
> creating build
> creating build/lib.macosx-11.2-arm64-3.9
> copying src/pyaudio.py → build/lib.macosx-11.2-arm64-3.9
> running build_ext
> building ‘_portaudio’ extension
> creating build/temp.macosx-11.2-arm64-3.9
> creating build/temp.macosx-11.2-arm64-3.9/src
> clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DMACOSX=1 -I/Users/lorenzo/.pyenv/versions/3.9.6/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-11.2-arm64-3.9/src/_portaudiomodule.o
> src/_portaudiomodule.c:29:10: fatal error: ‘portaudio.h’ file not found
> #include "portaudio.h"
**> ^~~~~~~~~~~~~
> 1 error generated.
> error: command ‘/usr/bin/clang’ failed with exit code 1
> ----------------------------------------
> ERROR: Failed building wheel for pyaudio
> Running setup.py clean for pyaudio
> Failed to build pyaudio
> Installing collected packages: pyaudio
> Running setup.py install for pyaudio … error
> ERROR: Command errored out with exit status 1:
> command: /Users/lorenzo/.pyenv/versions/3.9.6/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/setup.py’"’"’; file =’"’"’/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file ) if os.path.exists(file ) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file , ‘"’"‘exec’"’"’))’ install --record /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-record-kh7kda76/install-record.txt --single-version-externally-managed --compile --install-headers /Users/lorenzo/.pyenv/versions/3.9.6/include/python3.9/pyaudio
> cwd: /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/
> Complete output (16 lines):
> running install
> running build
> running build_py
> creating build
> creating build/lib.macosx-11.2-arm64-3.9
> copying src/pyaudio.py → build/lib.macosx-11.2-arm64-3.9
> running build_ext
> building ‘_portaudio’ extension
> creating build/temp.macosx-11.2-arm64-3.9
> creating build/temp.macosx-11.2-arm64-3.9/src
> clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DMACOSX=1 -I/Users/lorenzo/.pyenv/versions/3.9.6/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-11.2-arm64-3.9/src/_portaudiomodule.o
> src/_portaudiomodule.c:29:10: fatal error: ‘portaudio.h’ file not found
> #include "portaudio.h"
**> ^~~~~~~~~~~~~**
> 1 error generated.
> error: command ‘/usr/bin/clang’ failed with exit code 1
> ----------------------------------------
> ERROR: Command errored out with exit status 1: /Users/lorenzo/.pyenv/versions/3.9.6/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/setup.py’"’"’; file =’"’"’/private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-install-2z4mdbxz/pyaudio_80ea1677df5b409eb55baba2876c2d0e/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file ) if os.path.exists(file ) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file , ‘"’"‘exec’"’"’))’ install --record /private/var/folders/0r/rh5_255954d03k_80hzy8ynr0000gn/T/pip-record-kh7kda76/install-record.txt --single-version-externally-managed --compile --install-headers /Users/lorenzo/.pyenv/versions/3.9.6/include/python3.9/pyaudio Check the logs for full command output.
The plot is thickening…
Anyone using macos big sure able to help? I am willing to contribute to bug fixing etc but i need to start somewhere.
dae
August 30, 2021, 11:56am
7
The mentions of arm in your logs imply you’re not running the build in x86 mode, and you do not appear to have followed the instructions about the Python version in the docs.
I did follow the install at python.org . The python installation is messed up on the mac. But I am in the pyenv now. What makes you think that I didn’t? Of course, I am not running the
Is it possible to write constructive responses instead of dismissing posts like mine seeking basic answers to making sense of this spaghetti plate called Anki?
If the arm compile is not supported, then where is the disclaimer stating that so I don’t waste my time trying to build it on an Apple chip in the first place?
dae
August 31, 2021, 10:50am
9
The code builds fine on an M1, and I pointed you to the likely cause of the problems you’re having. Support is provided here for free, and the way you have conducted yourself does not motivate me to help you any further.
2 Likes
dae
August 31, 2021, 10:58am
10
(Re your other post, it was rightfully flagged by a community member. Please avoid posting on topics if you do not have something constructive to add. Some forum guidelines are available here: FAQ - Anki Forums )
1 Like