最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python 3.x - Unable to install pyaudio via homebrew - Stack Overflow

programmeradmin1浏览0评论
In file included from src/pyaudio/device_api.c:1:
      In file included from src/pyaudio/device_api.h:7:
      /Library/Frameworks/Python.framework/Versions/3.13/include/python3.13/Python.h:19:10: fatal error: 'assert.h' file not found
         19 | #include <assert.h>               // assert()
            |          ^~~~~~~~~~
      1 error generated.
      error: command '/Library/Developer/CommandLineTools/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyaudio)

I tried every method possible but can't resolve the issue.

In file included from src/pyaudio/device_api.c:1:
      In file included from src/pyaudio/device_api.h:7:
      /Library/Frameworks/Python.framework/Versions/3.13/include/python3.13/Python.h:19:10: fatal error: 'assert.h' file not found
         19 | #include <assert.h>               // assert()
            |          ^~~~~~~~~~
      1 error generated.
      error: command '/Library/Developer/CommandLineTools/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyaudio)

I tried every method possible but can't resolve the issue.

Share Improve this question edited Mar 10 at 10:18 hnwoh 6751 gold badge9 silver badges19 bronze badges asked Mar 4 at 10:39 Archit RajputArchit Rajput 11 bronze badge 1
  • The error message is clear, the system is missing a header file that is required to build the pyaudio package. Check your compiler and sdk locations are setup correctly, and your path variable locates them. – OldBoy Commented Mar 4 at 11:03
Add a comment  | 

1 Answer 1

Reset to default 0

PyAudio depends on the portaudio library. On macOS, you need to use Homebrew to install the prerequisite portaudio library:

brew install portaudio

before installing PyAudio using pip:

pip install pyaudio

See the docs.

发布评论

评论列表(0)

  1. 暂无评论