PortAudio and pyaudio | Generated by AI
The error occurs because pyaudio requires the PortAudio development headers to compile, which are missing on your system. Here’s how to fix it:
Step-by-Step Solution:
- Install PortAudio Development Headers (required for pyaudio):
sudo apt update && sudo apt install portaudio19-dev
- Install Python Development Tools (if not already installed):
sudo apt install python3-dev
- Retry the Installation:
pip install -r requirements.local.txt
If You Still Encounter pycrypto Issues:
The pycrypto package is deprecated and may have compatibility issues. Replace it with pycryptodome by modifying your requirements.local.txt
:
- Open the requirements file:
nano requirements.local.txt
- Replace
pycrypto
with:pycryptodome
- Save and re-run the installation:
pip install -r requirements.local.txt
Why This Works:
portaudio19-dev
provides the missing PortAudio headers needed to compile pyaudiopython3-dev
includes necessary Python development headerspycryptodome
is a maintained drop-in replacement for the deprecated pycrypto
Alternative for pycrypto (if you must keep it):
If you specifically need pycrypto, install build dependencies first:
sudo apt install build-essential libgmp-dev
pip install pycrypto
But note pycrypto has compatibility issues with newer Python versions.
After these steps, all packages should install correctly. The DEPRECATION warnings about legacy builds are informational and won’t prevent installation - they indicate the packages will need migration to PEP 517 builds in the future.