Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1234

Python • pyAudio install used to work, but now gives wheel error

$
0
0
Hello all. I'm installing PyAudio on a RasberryPi Zero 2W, headless, with Raspberry Pi OS Lite (64-bit). (12, Bookworm).

A few months ago, I did this successfully in a venv after I figured out I had to install portaudio first.

Code:

(venv) pi@raspberrypi:~ $ sudo apt-get install portaudio19-dev(venv) pi@raspberrypi:~ $ pip install pyAudio
It worked, and I can output sound via a USB adaptor, although there are some playback quirks I am ironing out. In a proper debug mood, I made a clean OS install on a new SD card, but this time I couldn't test my code as the install itself did not work.

The portaudio install works, but the pyAudio does not. Other pip installs like StupidArtNet also work.

A) Why would this have worked a few months ago, but not now? There have only been minor updates to Bookworm since then.
B) Forum searches tell me to install python3-dev. But I didn't need to do this a few months ago. Is this what I need to do now?

Error log:

Code:

(venv) pi@raspberrypi:~ $ pip install pyAudioLooking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting pyAudio  Using cached PyAudio-0.2.14.tar.gz (47 kB)  Installing build dependencies ... done  Getting requirements to build wheel ... done  Preparing metadata (pyproject.toml) ... doneBuilding wheels for collected packages: pyAudio  Building wheel for pyAudio (pyproject.toml) ... error  error: subprocess-exited-with-error    × Building wheel for pyAudio (pyproject.toml) did not run successfully.  │ exit code: 1  ╰─> [15 lines of output]      running bdist_wheel      running build      running build_py      creating build/lib.linux-aarch64-cpython-311/pyaudio      copying src/pyaudio/__init__.py -> build/lib.linux-aarch64-cpython-311/pyaudio      running build_ext      building 'pyaudio._portaudio' extension      creating build/temp.linux-aarch64-cpython-311/src/pyaudio      aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/include -I/usr/include -I/home/pi/venv/include -I/usr/include/python3.11 -c src/pyaudio/device_api.c -o build/temp.linux-aarch64-cpython-311/src/pyaudio/device_api.o      In file included from src/pyaudio/device_api.c:1:      src/pyaudio/device_api.h:7:10: fatal error: Python.h: No such file or directory          7 | #include "Python.h"            |          ^~~~~~~~~~      compilation terminated.      error: command '/usr/bin/aarch64-linux-gnu-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 pyAudioFailed to build pyAudioERROR: Could not build wheels for pyAudio, which is required to install pyproject.toml-based projects

Statistics: Posted by ericjforman — Fri Dec 06, 2024 8:55 pm



Viewing all articles
Browse latest Browse all 1234

Trending Articles