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

后端 未结 10 2161
我在风中等你
我在风中等你 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:16

    I needed to do the following to install PortAudio on Debian

    sudo apt install portaudio19-dev
    

    I also apt install'd python3-portaudio before that, although it didn't work. I'm not sure if that contributed as well.

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

    On Ubuntu builds:

    sudo apt-get install python-pyaudio
    

    For Python3:

    sudo apt-get install python3-pyaudio
    
    0 讨论(0)
  • 2020-11-29 21:26

    You have to install portaudio first then link that file. Only then you can find that header file (i.e, portaudio.h). To install portaudio in mac by using HomeBrew program use following commands.

    brew install portaudio
    brew link portaudio
    pip install pyaudio
    

    sudo is not needed if you're admin. We should refrain using sudo as it messes up lots of permissions.

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

    If you are using anaconda/miniconda to manage your python environments then

    conda install pyaudio

    installs portaudio at the same time as pyaudio

    The following NEW packages will be INSTALLED:
    
      portaudio          pkgs/main/osx-64::portaudio-19.6.0-h647c56a_4
      pyaudio            pkgs/main/osx-64::pyaudio-0.2.11-py37h1de35cc_2
    
    0 讨论(0)
  • 2020-11-29 21:29

    on Centos:

    yum install -y portaudio portaudio-devel && pip install pyaudio
    
    0 讨论(0)
  • 2020-11-29 21:29

    For me on 10.10.5 the paths were under /opt/local. I had to add /opt/local/bin to my /etc/paths file. And the command line that worked was

    sudo pip install --global-option='build_ext' --global-option='-I/opt/local/include' --global-option='-L/opt/local/lib' pyaudio

    0 讨论(0)
提交回复
热议问题