環境
macOS Big Sur ver.12.6 (21G115)
MacBook Air M1, 2020
8GB
Homebreq ver.3.6.3(git revision 86ac48865b7; last commit 2022-10-02)
Python 3.10.6
pip 22.2.2 from /opt/homebrew/lib/python3.10/site-packages/pip (python 3.10)
エラー内容
MacBook-Air ~ % pip3 install pyaudio Collecting pyaudio Using cached PyAudio-0.2.12.tar.gz (42 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: pyaudio Building wheel for pyaudio (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for pyaudio (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [18 lines of output] Error in sitecustomize; set PYTHONVERBOSE for traceback: AssertionError: running bdist_wheel running build running build_py creating build creating build/lib.macosx-11-arm64-cpython-310 copying src/pyaudio.py -> build/lib.macosx-11-arm64-cpython-310 running build_ext building '_portaudio' extension creating build/temp.macosx-11-arm64-cpython-310 creating build/temp.macosx-11-arm64-cpython-310/src clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -DMACOSX=1 -I/usr/local/include -I/usr/include -I/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/_portaudiomodule.c -o build/temp.macosx-11-arm64-cpython-310/src/_portaudiomodule.o src/_portaudiomodule.c:31:10: fatal error: 'portaudio.h' file not found #include "portaudio.h" ^~~~~~~~~~~~~ 1 error generated. error: command '/usr/bin/clang' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyaudio Failed to build pyaudio ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects
やったこと
ひとまず最後のところのエラー文を検索にかけて
https://stackoverflow.com/questions/73268630/error-could-not-build-wheels-for-pyaudio-which-is-required-to-install-pyprojec
このサイトを見ました.
sudo apt install portaudio19-dev
をするように書いてあり,Homebrewに対して同じような操作を行うために.
brew install portaudio19-dev
をしてみたのですが.
MacBook-Air ~ % brew install portaudio19-dev Running `brew update --auto-update`... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> New Formulae jj netcdf-cxx rome mycorrhiza netcdf-fortran tbls You have 3 outdated formulae installed. You can upgrade them with brew upgrade or list them with brew outdated. ==> Tapping homebrew/cask Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'... remote: Enumerating objects: 675808, done. remote: Counting objects: 100% (19/19), done. remote: Compressing objects: 100% (19/19), done. remote: Total 675808 (delta 8), reused 9 (delta 0), pack-reused 675789 Receiving objects: 100% (675808/675808), 320.53 MiB | 6.26 MiB/s, done. Resolving deltas: 100% (479579/479579), done. Tapped 4083 casks (4,155 files, 342MB). Warning: No available formula with the name "portaudio19-dev". Did you mean portaudio? ==> Searching for similarly named formulae... This similarly named formula was found: portaudio ✔ To install it, run: brew install portaudio ✔ ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching taps on GitHub... Error: No formulae found in taps.
のようになってしまいました.
他にも調べてみると,Pythonのバージョンが3.7以上だと非公式の
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
に取りにいかなければいけないとあったのですが,どれをダウンロードすべきなのかわかりませんでした.
pyaudioを正しくインストールするのはどうすれば良いのでしょうか.

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。
2022/10/05 12:17