I got this error while deploying (portaudio.h)

Building wheels for collected packages: pyaudio
  Building wheel for pyaudio (pyproject.toml): started
  Building wheel for pyaudio (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for pyaudio (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/pyaudio
      copying src/pyaudio/__init__.py -> build/lib.linux-x86_64-cpython-39/pyaudio
      running build_ext
      building 'pyaudio._portaudio' extension
      creating build/temp.linux-x86_64-cpython-39
      creating build/temp.linux-x86_64-cpython-39/src
      creating build/temp.linux-x86_64-cpython-39/src/pyaudio
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include -I/usr/include -I/home/adminuser/venv/include -I/usr/local/include/python3.9 -c src/pyaudio/device_api.c -o build/temp.linux-x86_64-cpython-39/src/pyaudio/device_api.o
      src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: No such file or directory
          9 | #include "portaudio.h"
            |          ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' 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: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects
WARNING: You are using pip version 22.0.3; however, version 23.2.1 is available.
You should consider upgrading via the '/home/adminuser/venv/bin/python -m pip install --upgrade pip' command.
Checking if Streamlit is installed

Hey @ishantai95,

Thanks for sharing your question! Could you please update your post to include a link to your app’s GitHub repo and the deployed app?

You need at least the following apt package:

packages.txt

portaudio19-dev

I added that to packages.txt but still couldn’t deploy to render. How do I make it so that Render installs packages.txt before deploying? It seems like there’s only one build command available for deploying on render, and I need to use it for pip install -r requirements.txt

@Franky1 @Caroline

Are you deploying this app on Render or Streamlit Community Cloud?

Render. I circumvented the issue temporarily by using the st_audiorec component, but I don’t like the UI that comes with it. Thank you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.