Failed to install pyaudio in Uno-Q virtual environment

Question/Issue:
When following the tutorial instructions found here…

…I get errors when I try to install pyaudio in the virtual environment…

$ pip install --upgrade pip pyaudio six

Fails…
Project ID:

Context/Use case:
When trying to repeat the OCR Detect/Recognize tutorial

Expected Outcome:
Installation of pyaudio package

Actual Outcome:
Installation fails with errors

Reproducibility:

  • [*] Always
  • [ ] Sometimes
  • [ ] Rarely

Environment:

  • Platform: Uno-Q 4GB

Additional Information:
[Any other information that might be relevant]

Action and error message output.

(dje-venv) arduino@dje-uno-Q:~/ocr-linux-arduino-uno-q$ pip install pyaudio
Collecting 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) … done
Building 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
╰─> [28 lines of output]
/tmp/pip-build-env-2hmc26nm/overlay/lib/python3.13/site-packages/setuptools/dist.py:765: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: MIT License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running bdist_wheel
  running build
  running build_py
  creating build/lib.linux-aarch64-cpython-313/pyaudio
  copying src/pyaudio/__init__.py -> build/lib.linux-aarch64-cpython-313/pyaudio
  running build_ext
  building 'pyaudio._portaudio' extension
  creating build/temp.linux-aarch64-cpython-313/src/pyaudio
  aarch64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -I/usr/local/include -I/usr/include -I/home/arduino/ocr-linux-arduino-uno-q/dje-venv/include -I/usr/include/python3.13 -c src/pyaudio/device_api.c -o build/temp.linux-aarch64-cpython-313/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 pyaudio
Failed to build pyaudio
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyaudio)
(dje-venv) arduino@dje-uno-Q:~/ocr-linux-arduino-uno-q$

1 Like

Hello @DJE666

first of all thanks for coming here to share the issue!

Could you please share the complete trace of logs after running

python -m venv .venv
source .venv/bin/activate

pip install --upgrade pip pyaudio six
pip install -r requirements.txt

You mentioned that following these instructions everything works well

You mean that skipping the:

pip install --upgrade pip pyaudio six

works well?

Thanks

Hello Marcpous,

The simplified instructions appear to bypass all the venv setup and package installation requirements.

  • I clone the project to the Uno-Q as directed.

  • A new app appeared in the Uno-Q “My Apps” directory
    image

  • I run the app.

It seems that your instructions are trying to manually setup a new project on the Uno-Q, where the simplified instructions are not.?

However, I want to replicate your work “step-by-step” so that I better understand how to build edge-AI systems for the Uno-Q with multiple models running in a single app.

Regards,

DJE666

1 Like

Gotcha! thanks for sharing that using Arduino AppLab works well :slight_smile:

Feel free to share all the logs to check why it’s not working on your side!

Marc