root@linx:/home/d5000/fujian/ZhongKeRuan/soft/libffi-3.2.1# pip install pyaudio
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that
date. A future version of pip will drop support for Python 2.7.Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Complete output from command /usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-FnOnKz/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-record-GE1TbX/install-record.txt --single-version-externally-managed --compile: ERROR: running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying src/pyaudio.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-str
ong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o src/_portaudiomodule.c:29:23: fatal error: portaudio.h: 没有那个文件或目录
#include "portaudio.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-FnOnKz/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-record-GE1TbX/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-FnOnKz/pyaudio/root@linx:/home/d5000/fujian/ZhongKeRuan/soft/libffi-3.2.1#
先贴出pip安装代码所报的错吧
然后再贴出使用本地离线安装所报的错
离线安装的步骤是去这个模块的官网上去下载这个模块,然后拷贝上传,然后再进行解压,加压之后进去,执行命令:
python setup.py install 进行安装
报错:
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
观察这个报错信息和上边的是相同的,所以
1、在解决报错问题上边,先解决下边这个报错问题,上边那个报错问题也就解决了
2、pip安装代码的原理是:
使用pip install moduleName就相当于:①找到对应的模块进行加载【而且是对应的版本】,②上传到对应的目录下,③解压,④按照要求进行执行命令