欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Centos7服务器上配置GPU的tensorflow:python3安装pyaudio的坑

程序员文章站 2022-05-29 12:14:45
...

# 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。