when installing pyaudio, pip cannot find portaudio.h in /usr/local/include

后端 未结 10 2162
我在风中等你
我在风中等你 2020-11-29 21:04

I\'m using mac osx 10.10 As the PyAudio Homepage said, I install the PyAudio using

brew install portaudio 
pip install pyaudio

the installa

相关标签:
10条回答
  • 2020-11-29 21:30

    Just for the record for folks using MacPorts and not Homebrew:

    $ [sudo] port install portaudio
    $ pip install pyaudio --global-option="build_ext"  --global-option="-I/opt/local/include" --global-option="-L/opt/local/lib"
    
    0 讨论(0)
  • 2020-11-29 21:34

    First you can use brew to install portaudio .

    brew install portaudio

    Then try to find the portaudio path sudo find / -name "portaudio.h"

    In my case it is /usr/local/Cellar/portaudio/19.6.0/include .

    Run the below to install pyaudio

    pip install --global-option='build_ext' --global-option='-I/usr/local/Cellar/portaudio/19.6.0/include' --global-option='-L/usr/local/Cellar/portaudio/19.6.0/lib' pyaudio

    0 讨论(0)
  • 2020-11-29 21:40

    Since pyAudio has portAudio as a dependency, you first have to install portaudio.

    brew install portaudio
    

    Then try: pip install pyAudio. If the problem persists after installing portAudio, you can specify the directory path where the compiler will be able to find the source programs (e.g: portaudio.h). Since the headers should be in the /usr/local/include directory:

    pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
    
    0 讨论(0)
  • 2020-11-29 21:41

    On Raspbian:

    sudo apt-get install python-pyaudio
    
    0 讨论(0)
提交回复
热议问题