在Mac OS Moj上执行pip install pyaudio时出错

2024-05-23 13:33:26 发布

您现在位置:Python中文网/ 问答频道 /正文

Collecting pyaudio Downloading https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz Building wheels for collected packages: pyaudio Building wheel for pyaudio (setup.py) ... error ERROR: Command errored out with exit status 1: command: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-_jk8c3tj/pyaudio/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-_jk8c3tj/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-ze2dwvn0 --python-tag cp36 cwd: /private/tmp/pip-install-_jk8c3tj/pyaudio/ Complete output (16 lines): running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.6 copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6 running build_ext building '_portaudio' extension creating build/temp.macosx-10.7-x86_64-3.6 creating build/temp.macosx-10.7-x86_64-3.6/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -DMACOSX=1 -I/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found #include "portaudio.h" ^~~~~~~~~~~~~ 1 error generated. error: command 'gcc' failed with exit status 1


ERROR: Failed building wheel for pyaudio Running setup.py clean for pyaudio Failed to build pyaudio Installing collected packages: pyaudio Running setup.py install for pyaudio ... error ERROR: Command errored out with exit status 1: command: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-_jk8c3tj/pyaudio/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-_jk8c3tj/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 /private/tmp/pip-record-a_zim1cg/install-record.txt --single-version-externally-managed --compile cwd: /private/tmp/pip-install-_jk8c3tj/pyaudio/ Complete output (16 lines): running install running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.6 copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6 running build_ext building '_portaudio' extension creating build/temp.macosx-10.7-x86_64-3.6 creating build/temp.macosx-10.7-x86_64-3.6/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -DMACOSX=1 -I/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found #include "portaudio.h" ^~~~~~~~~~~~~ 1 error generated. error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-_jk8c3tj/pyaudio/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-_jk8c3tj/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 /private/tmp/pip-record-a_zim1cg/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.


Tags: installpippybuildsrcsetuperrorprivate