aws-samples / aws-samples/amazon-nova-samples
(S2S sample-codes/console-python) fatal error: 'portaudio.h' file not found
- Dominant language
- Jupyter Notebook
- Stars
- 452
- Forks
- 266
- PR merge metrics
- No merged PRs in 30d
Description
When trying to `pip install` as described in [speech-to-speech/sample-codes/console-python](https://github.com/aws-samples/amazon-nova-samples/tree/main/speech-to-speech/sample-codes/console-python), I'm getting the following error:
```
self._finalize_license_expression()
running bdist_wheel
running build
running build_py
creating build/lib.macosx-11.0-arm64-cpython-313/pyaudio
copying src/pyaudio/__init__.py -> build/lib.macosx-11.0-arm64-cpython-313/pyaudio
running build_ext
building 'pyaudio._portaudio' extension
creating build/temp.macosx-11.0-arm64-cpython-313/src/pyaudio
cc -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -fPIC -DMACOS=1 -I/usr/local/include -I/usr/include -I/opt/homebrew/include -I/{...}/amazon-nova-samples/speech-to-speech/sample-codes/console-python/.venv/include -I/Users/{me}/.local/share/mise/installs/python/3.13.1/include/python3.13 -c src/pyaudio/device_api.c -o build/temp.macosx-11.0-arm64-cpython-313/src/pyaudio/device_api.o
src/pyaudio/device_api.c:9:10: fatal error: 'portaudio.h' file not found
9 | #include "portaudio.h"
| ^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/cc' 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
Building wheel for ijson (pyproject.toml) ... done
Created wheel for ijson: filename=ijson-3.3.0-py3-none-any.whl size=29897 sha256=bcfdac858594169c4c8204f3e18ad6695c4bae1131368b344553d643e7d44645
Stored in directory: /Users/{me}/Library/Caches/pip/wheels/54/e2/c7/ea0ff2f325d164220e9e6c1c830890538f530c88069345ab15
Successfully built ijson
Failed to build pyaudio
[notice] A new release of pip is available: 24.3.1 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyaudio)
```
From [this StackOverflow answer](https://stackoverflow.com/a/33821084), it seems like installing `portaudio` is a required pre-requisite that isn't mentioned in the README? Verified that running `brew install portaudio` fixes the issue, so we should probably document this.
Observed on MacOS 15.3 (M2 Pro chip)
Contributor guide
Assessment
This issue has not been assessed yet.