1. 程式人生 > >Centos7伺服器上配置GPU的tensorflow:python3安裝pyaudio的坑

Centos7伺服器上配置GPU的tensorflow:python3安裝pyaudio的坑

# pip install pyaudio 命令安裝python3.6的pyaudio包報錯:

fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

原因是缺少標頭檔案, 需要先安裝portaudio。
安裝portaudio:
去portaudio.com/download.html 網站下載 pa_stable_v190600_20161030.tgz (或其他版本)

# wget http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz
# tar pa_stable_v190600_20161030.tgz
# cd portaudio
# ./configure
# make
# make install

然後安裝pyaudio就可以了

# pip install pyaudio

安裝成功版本為0.2.11。