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
1 Answer
Reset to default 0PyAudio 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.