【发布时间】:2018-04-10 15:46:55
【问题描述】:
我想使用 Python 的 SpeechRecognition 库,但是当我尝试运行一个使用麦克风的程序时,我打算这样做,我收到错误
“需要 PyAudio 0.2.11 或更高版本(找到版本 0.2.9)”
所以我做了一些挖掘并找到了如何使用 apt-get 安装它。不幸的是,我运行 Fedora 26,所以我必须使用 yum 来安装我的软件包,当我寻找使用它安装 PyAudio 的方法时,我只能找到 0.2.9 版本。
每当我尝试做时
pip 安装 pyaudio
我收到以下错误:
pyaudio 的构建*失败 为 pyaudio 运行 setup.py clean 无法构建 pyaudio 安装收集的包:pyaudio 为 pyaudio 运行 setup.py install ... 错误 命令的完整输出 /usr/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ZiuxD3/pyaudio/setup.py';f=getattr( tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec( compile(code, file, 'exec'))" install --record /tmp/pip-a2Iwxv-record/install-record.txt --single-version-externally-managed --compile: 运行安装 运行构建 运行 build_py 创建构建 创建 build/lib.linux-x86_64-2.7 复制 src/pyaudio.py -> build/lib.linux-x86_64-2.7 运行 build_ext 构建“_portaudio”扩展 创建 build/temp.linux-x86_64-2.7 创建 build/temp.linux-x86_64-2.7/src gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 - grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 - m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o gcc:错误:/usr/lib/rpm/redhat/redhat-hardened-cc1:没有这样的文件或目录 错误:命令“gcc”失败,退出状态为 1
----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ZiuxD3/pyaudio/setup.py';f=getattr (tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec (compile(code, file, 'exec'))" install --record /tmp/pip-a2Iwxv-record/install-record.txt --single-version-externally-managed --compile " 失败,错误代码 1 在 /tmp/pip-build-ZiuxD3/pyaudio/
【问题讨论】:
标签: python speech-recognition fedora pyaudio