3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

M1mac Pyaudioインストール時エラー対応

Last updated at Posted at 2021-03-03

Pyaudioのインストール

Pyaudioのインストール時にエラーとなったので、自分用メモ

実行環境

Homebrew 3.0.2
Python 3.9.2

インストール

Pyaudioにはportaudioというライブラリが必要とのことなのでHomebrewでインストール

$ brew install portaudio
$ pip3 install pyaudio

Pyaudioインストール時にfatal error: 'portaudio.h' file not foundというエラーが発生

エラー対応

下記オプションを指定し再インストール

pip3 install --global-option='build_ext' --global-option='-I/opt/homebrew/include' --global-option='-L/opt/homebrew/lib' pyaudio

または

$ export LDFLAGS=-L/opt/homebrew/lib
$ export CPPFLAGS=-I/opt/homebrew/include
$ pip3 install pyaudio

確認

$ pip3 freeze
PyAudio==0.2.11

インストール成功!

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?