Pyaudio installation error - 'command 'gcc' failed with exit status 1'

被刻印的时光 ゝ 提交于 2019-11-27 11:53:34

Found an answer at https://groups.google.com/forum/#!msg/pyo-discuss/ptp_m39ACpI/XgKdK8YGNSoJ

sudo apt-get install portaudio19-dev

Well, I solved the problem by using the package manager,

 $ sudo apt-get install python-pyaudio

Although still has no clue why easy_install fails.

On ubuntu 13.10 aka Saucy Salamander, I solved the problem by installing libjack-jackd2-dev and portaudio19-dev.

sudo apt-get install libjack-jackd2-dev portaudio19-dev

Then pip install pyaudio should work.

I install in my virtualenv. pyaudio (0.2.11)

  1. pip install pyaudio -> error
  2. sudo apt-get install portaudio19-dev -> success
  3. pip install pyaudio -> success

This is how I get it work:

  1. brew update (you can ignore this step if your brew is up to date)
  2. brew install portaudio
  3. brew link --overwrite portaudio
  4. sudo python2.7 -m pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio

I found this question after experiencing a similar error on OpenSuse (13.2). So I figured I'd post my solution as well, in case other people find this via Google.

Although libportaudio2 is the package containing the libs, you need portaudio-devel as well to make the installation work.

Kaleb McGregor

On Fedora 27 in order to get pyaudio from a default python3 installation I did the following

sudo dnf install python3-devel
sudo dnf install portaudio-devel
sudo pip3 install pyaudio

Use the following command to install pyaudio

sudo apt-get install python-pyaudio

Install portaudio-dev or whatnot as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!