简体   繁体   English

安装 PyAudio 时出错“PyAudio 的构建轮失败”

[英]Errors installing PyAudio "Failed Building Wheel for PyAudio"

I have been having trouble finding a fix for getting PyAudio installed on my machine.我一直无法找到在我的机器上安装 PyAudio 的修复程序。 I have tried a few different solutions and i do have the prerequisite library "portaudio" installed using homebrew.我尝试了几种不同的解决方案,并且确实使用自制软件安装了必备库“portaudio”。 I have also looked for solutions to the gcc error that appears at the bottom of the output and to which solutions only generated a different error that read "Error: command 'clang' failed with exit status 1".我还寻找了出现在输出底部的 gcc 错误的解决方案,而这些解决方案只生成了一个不同的错误,内容为“错误:命令‘clang’失败,退出状态为 1”。 I feel at this point it is some lack of understanding of the implications of these error messages due to a lack of experience in python that keeps me from understanding a resolution.我觉得在这一点上,由于缺乏 Python 经验,我对这些错误消息的含义缺乏了解,这使我无法理解解决方案。 Any help is greatly appreciated.任何帮助是极大的赞赏。 Thank you.谢谢你。

MacBook-Pro-2:~ MyName$ pip install pyaudio
Collecting pyaudio
  Using cached PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
  Running setup.py bdist_wheel for pyaudio ... error
  Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/tmpxdj3hlo2pip-wheel- --python-tag cp36:
  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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
  In file included from src/_portaudiomodule.c:33:
  In file included from /usr/local/include/pa_mac_core.h:48:
  In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
  In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
  In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
  /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
  #       error Never include this file directly. Use <lzma.h> instead.
          ^
  /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
          lzma_check check;
          ^
  /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
          lzma_vli compressed_size;
          ^
  /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
          lzma_vli uncompressed_size;
          ^
  /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
          lzma_filter *filters;
          ^
  /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
          uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                            ^
  /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int3;
          ^
  /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int4;
          ^
  /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int5;
          ^
  /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int6;
          ^
  /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int7;
          ^
  /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int8;
          ^
  /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum1;
          ^
  /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum2;
          ^
  /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum3;
          ^
  /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum4;
          ^
  /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
          lzma_bool ignore_check;
          ^
  /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool2;
          ^
  /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool3;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  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
    Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile:
    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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
    In file included from src/_portaudiomodule.c:33:
    In file included from /usr/local/include/pa_mac_core.h:48:
    In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
    In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
    In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
    /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
    #       error Never include this file directly. Use <lzma.h> instead.
            ^
    /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
            lzma_check check;
            ^
    /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
            lzma_vli compressed_size;
            ^
    /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
            lzma_vli uncompressed_size;
            ^
    /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
            lzma_filter *filters;
            ^
    /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
            uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                              ^
    /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int3;
            ^
    /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int4;
            ^
    /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int5;
            ^
    /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int6;
            ^
    /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int7;
            ^
    /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int8;
            ^
    /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum1;
            ^
    /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum2;
            ^
    /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum3;
            ^
    /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum4;
            ^
    /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
            lzma_bool ignore_check;
            ^
    /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool2;
            ^
    /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool3;
            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/pyaudio/

I have been having trouble finding a fix for getting PyAudio installed on my machine.我一直找不到要在我的机器上安装PyAudio的修复程序。 I have tried a few different solutions and i do have the prerequisite library "portaudio" installed using homebrew.我尝试了几种不同的解决方案,并且确实使用自制软件安装了必备库“ portaudio”。 I have also looked for solutions to the gcc error that appears at the bottom of the output and to which solutions only generated a different error that read "Error: command 'clang' failed with exit status 1".我还寻找了输出底部出现的gcc错误的解决方案,并且解决方案仅生成了一个不同的错误,显示为“错误:命令'clang'失败,退出状态为1”。 I feel at this point it is some lack of understanding of the implications of these error messages due to a lack of experience in python that keeps me from understanding a resolution.由于缺少python的经验,我感到这时对这些错误消息的含义有些不了解,这使我无法理解解决方案。 Any help is greatly appreciated.任何帮助是极大的赞赏。 Thank you.谢谢你。

MacBook-Pro-2:~ MyName$ pip install pyaudio
Collecting pyaudio
  Using cached PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
  Running setup.py bdist_wheel for pyaudio ... error
  Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/tmpxdj3hlo2pip-wheel- --python-tag cp36:
  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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
  In file included from src/_portaudiomodule.c:33:
  In file included from /usr/local/include/pa_mac_core.h:48:
  In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
  In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
  In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
  /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
  #       error Never include this file directly. Use <lzma.h> instead.
          ^
  /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
          lzma_check check;
          ^
  /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
          lzma_vli compressed_size;
          ^
  /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
          lzma_vli uncompressed_size;
          ^
  /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
          lzma_filter *filters;
          ^
  /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
          uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                            ^
  /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int3;
          ^
  /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int4;
          ^
  /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int5;
          ^
  /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int6;
          ^
  /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int7;
          ^
  /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int8;
          ^
  /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum1;
          ^
  /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum2;
          ^
  /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum3;
          ^
  /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum4;
          ^
  /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
          lzma_bool ignore_check;
          ^
  /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool2;
          ^
  /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool3;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  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
    Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile:
    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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
    In file included from src/_portaudiomodule.c:33:
    In file included from /usr/local/include/pa_mac_core.h:48:
    In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
    In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
    In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
    /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
    #       error Never include this file directly. Use <lzma.h> instead.
            ^
    /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
            lzma_check check;
            ^
    /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
            lzma_vli compressed_size;
            ^
    /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
            lzma_vli uncompressed_size;
            ^
    /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
            lzma_filter *filters;
            ^
    /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
            uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                              ^
    /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int3;
            ^
    /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int4;
            ^
    /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int5;
            ^
    /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int6;
            ^
    /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int7;
            ^
    /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int8;
            ^
    /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum1;
            ^
    /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum2;
            ^
    /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum3;
            ^
    /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum4;
            ^
    /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
            lzma_bool ignore_check;
            ^
    /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool2;
            ^
    /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool3;
            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/pyaudio/

I have been having trouble finding a fix for getting PyAudio installed on my machine.我一直找不到要在我的机器上安装PyAudio的修复程序。 I have tried a few different solutions and i do have the prerequisite library "portaudio" installed using homebrew.我尝试了几种不同的解决方案,并且确实使用自制软件安装了必备库“ portaudio”。 I have also looked for solutions to the gcc error that appears at the bottom of the output and to which solutions only generated a different error that read "Error: command 'clang' failed with exit status 1".我还寻找了输出底部出现的gcc错误的解决方案,并且解决方案仅生成了一个不同的错误,显示为“错误:命令'clang'失败,退出状态为1”。 I feel at this point it is some lack of understanding of the implications of these error messages due to a lack of experience in python that keeps me from understanding a resolution.由于缺少python的经验,我感到这时对这些错误消息的含义有些不了解,这使我无法理解解决方案。 Any help is greatly appreciated.任何帮助是极大的赞赏。 Thank you.谢谢你。

MacBook-Pro-2:~ MyName$ pip install pyaudio
Collecting pyaudio
  Using cached PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
  Running setup.py bdist_wheel for pyaudio ... error
  Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/tmpxdj3hlo2pip-wheel- --python-tag cp36:
  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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
  In file included from src/_portaudiomodule.c:33:
  In file included from /usr/local/include/pa_mac_core.h:48:
  In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
  In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
  In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
  /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
  #       error Never include this file directly. Use <lzma.h> instead.
          ^
  /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
          lzma_check check;
          ^
  /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
          lzma_vli compressed_size;
          ^
  /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
          lzma_vli uncompressed_size;
          ^
  /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
          lzma_filter *filters;
          ^
  /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
          uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                            ^
  /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int3;
          ^
  /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int4;
          ^
  /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int5;
          ^
  /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int6;
          ^
  /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int7;
          ^
  /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int8;
          ^
  /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum1;
          ^
  /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum2;
          ^
  /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum3;
          ^
  /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum4;
          ^
  /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
          lzma_bool ignore_check;
          ^
  /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool2;
          ^
  /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool3;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  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
    Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile:
    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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
    In file included from src/_portaudiomodule.c:33:
    In file included from /usr/local/include/pa_mac_core.h:48:
    In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
    In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
    In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
    /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
    #       error Never include this file directly. Use <lzma.h> instead.
            ^
    /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
            lzma_check check;
            ^
    /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
            lzma_vli compressed_size;
            ^
    /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
            lzma_vli uncompressed_size;
            ^
    /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
            lzma_filter *filters;
            ^
    /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
            uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                              ^
    /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int3;
            ^
    /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int4;
            ^
    /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int5;
            ^
    /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int6;
            ^
    /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int7;
            ^
    /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int8;
            ^
    /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum1;
            ^
    /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum2;
            ^
    /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum3;
            ^
    /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum4;
            ^
    /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
            lzma_bool ignore_check;
            ^
    /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool2;
            ^
    /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool3;
            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/pyaudio/

You can also use:您还可以使用:

pip install pipwin
pipwin install pyaudio

This doesn't use anaconda, just pip.这不使用anaconda,只使用pip。

I have been having trouble finding a fix for getting PyAudio installed on my machine.我一直找不到要在我的机器上安装PyAudio的修复程序。 I have tried a few different solutions and i do have the prerequisite library "portaudio" installed using homebrew.我尝试了几种不同的解决方案,并且确实使用自制软件安装了必备库“ portaudio”。 I have also looked for solutions to the gcc error that appears at the bottom of the output and to which solutions only generated a different error that read "Error: command 'clang' failed with exit status 1".我还寻找了输出底部出现的gcc错误的解决方案,并且解决方案仅生成了一个不同的错误,显示为“错误:命令'clang'失败,退出状态为1”。 I feel at this point it is some lack of understanding of the implications of these error messages due to a lack of experience in python that keeps me from understanding a resolution.由于缺少python的经验,我感到这时对这些错误消息的含义有些不了解,这使我无法理解解决方案。 Any help is greatly appreciated.任何帮助是极大的赞赏。 Thank you.谢谢你。

MacBook-Pro-2:~ MyName$ pip install pyaudio
Collecting pyaudio
  Using cached PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
  Running setup.py bdist_wheel for pyaudio ... error
  Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/tmpxdj3hlo2pip-wheel- --python-tag cp36:
  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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
  In file included from src/_portaudiomodule.c:33:
  In file included from /usr/local/include/pa_mac_core.h:48:
  In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
  In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
  In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
  In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
  /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
  #       error Never include this file directly. Use <lzma.h> instead.
          ^
  /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
          lzma_check check;
          ^
  /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
          lzma_vli compressed_size;
          ^
  /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
          lzma_vli uncompressed_size;
          ^
  /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
          lzma_filter *filters;
          ^
  /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
          uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                            ^
  /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int3;
          ^
  /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int4;
          ^
  /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int5;
          ^
  /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int6;
          ^
  /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int7;
          ^
  /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
          lzma_vli reserved_int8;
          ^
  /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum1;
          ^
  /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum2;
          ^
  /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum3;
          ^
  /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
          lzma_reserved_enum reserved_enum4;
          ^
  /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
          lzma_bool ignore_check;
          ^
  /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool2;
          ^
  /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
          lzma_bool reserved_bool3;
          ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  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
    Complete output from command /Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile:
    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/Users/MyName/anaconda3/include -arch x86_64 -I/Users/MyName/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/MyName/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
    In file included from src/_portaudiomodule.c:33:
    In file included from /usr/local/include/pa_mac_core.h:48:
    In file included from /System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h:1:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h:16:
    In file included from /System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h:167:
    In file included from /System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:30:
    In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
    /usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
    #       error Never include this file directly. Use <lzma.h> instead.
            ^
    /usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
            lzma_check check;
            ^
    /usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
            lzma_vli compressed_size;
            ^
    /usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
            lzma_vli uncompressed_size;
            ^
    /usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
            lzma_filter *filters;
            ^
    /usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
            uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                              ^
    /usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int3;
            ^
    /usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int4;
            ^
    /usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int5;
            ^
    /usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int6;
            ^
    /usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int7;
            ^
    /usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
            lzma_vli reserved_int8;
            ^
    /usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum1;
            ^
    /usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum2;
            ^
    /usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum3;
            ^
    /usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
            lzma_reserved_enum reserved_enum4;
            ^
    /usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
            lzma_bool ignore_check;
            ^
    /usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool2;
            ^
    /usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
            lzma_bool reserved_bool3;
            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/MyName/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/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 /var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-mxjvhl6h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/l8/g1463xmj059g0qmss57qr3bh0000gp/T/pip-build-r_jfrp4_/pyaudio/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM