1
0

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 5 years have passed since last update.

pipでpyAudioインストール時にはまった回避策。

Last updated at Posted at 2017-01-09

#問題
pyaudioインストール時にはまりました。

sudo pip install pyaudio
  cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DMACOSX=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o
  src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
  #include "portaudio.h"
  ^
  1 error generated.
  error: command 'cc' failed with exit status 1

portaudio.hが見つからないと言われて落ちます。
ところがpyaudioで必要とされるportaudioは、macportでインストール済みです。。

port list portaudio
portaudio                      @19.20140130    audio/portaudio

#回避策
なぜかpipがportaudioを見つけられてないことが問題です。
portのデフォルト/opt/local/以下にあることを確かめた上で、

sudo env LDFLAGS="-L/opt/local/lib" CFLAGS="-I/opt/local/include" pip install pyaudio

として直接指定してあげることでインストールできました。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?