[PYTHON] A workaround when installing pyAudio with pip.

problem

I got stuck when I installed 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

I am told that portaudio.h cannot be found and it fails. However, the portaudio required by pyaudio is already installed by macport. ..

port list portaudio
portaudio                      @19.20140130    audio/portaudio

Workaround

The problem is that pip can't find portaudio for some reason. Make sure it is under the port default / opt / local /

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

I was able to install it by directly specifying as.

Recommended Posts

A workaround when installing pyAudio with pip.
Installing packages with pip3
When moss with pip install
Precautions when installing a hierarchical include directory with waf
A memorandum when an error occurs with pip install
A story about installing matplotlib using pip with an error
Precautions when installing tensorflow with anaconda
How to deal with errors when installing Python and pip with choco
A memo for when pip3 is installed with python2.7 for some reason
A struggle when installing pyenv on Cygwin
Workaround if you get an error when trying to install PySide with pip
How to deal with errors when hitting pip ②
Pip install a private repository when building Docker
A memo when creating a python environment with miniconda
What to do if a communication error occurs due to proxy when installing with package management of pip, npm, gem
MultiDict: When doing form POST with a crawler, etc.
I got a UnicodeDecodeError when pip install on ubuntu
Problems when creating a csv-json conversion tool with python
When writing an if statement with a regular expression
When architecture not supported comes out with pip (Mac)
Current directory when creating a new one with Jupyter
A memorandum regarding Wifi connection when installing Arch Linux
A memorandum when making a surveillance camera with Raspberry Pi
I stumbled upon PyUnicodeUCS4_FromStringAndSize when inserting TensorFlow with pip
PIL installation with pip
A4 size with python-pptx
Stumbled when installing PyOCR
Error with pip install
Use pip with MSYS2
Problems with installing Scrapy
Precautions when installing fbprophet
Decorate with a decorator
Install scikit.learn with pip
When pip install fails
A story that stumbled when I made a chatbot with Transformer
[AWS] What to do when you want to pip with Lambda
I got a Value Error when using JUMAN ++ with PyKNP
Options when installing libraries that cannot be piped with pyenv
Behavior when giving a list with shell = True in subprocess
A memo when face is detected with Python + OpenCV quickly
[python] A note when trying to use numpy with Cython
A story that stumbled when using pip in a proxy environment
Use a macro that runs when saving python with vscode
Steps to install a Git cloned package locally with pip
After installing CentOS8 with VirtualBox, an error occurs when restarting
Delete all libraries installed on pip with a single command
Automatically enable virtualenv when cd to a directory with zsh
A collection of methods used when aggregating data with pandas
Defense notes when pip3 doesn't work with "ImportError: No module named'packaging'" after installing python3-pip on Debian8
Note installing modules such as pytorch and opencv with pip in Blender python (2.82a or later)