Pygame and Pyaudio module installation in Openwrt?

Hi All,

I was trying to install the python modules Pygame and Pyaudio in OpenWRT. But I'm receiving below errors

pip3 install pyaudio --trusted-host --trusted-host --trusted-host
Collecting pyaudio
Installing collected packages: pyaudio
  Running install for pyaudio ... error
**Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1x_v639r/pyaudio/';f=getattr(tokenize, 'open', open)(__file__);'\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-eakj0tac-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1x_v639r/pyaudio/**
pip3.6 install Pygame --trusted-host --trusted-host --trusted-host
Collecting Pygame
  Downloading (4.8MB)
    100% |████████████████████████████████| 4.8MB 1.2MB/s 
**Command "python egg_info" failed with error code 1 in /tmp/pip-build-00e5wc58/Pygame/**

I have tried with different python/pip versions (2, 2.7, 3, 3.6) and updated setuptools. Still I'm getting the above errors only.

Can anyone help me to get out from this issue?



The problem is complicated as the packages need to be compile which is not possible on target device.

Pyaudio does work but requires a different build process. Assuming your entware root is /opt/ :

opkg install git
opkg install alsa-utils
opkg install alsa-lib
opkg install portaudio
opkg install ar 

cd /opt/lib

# Entware file is named differently than the PyAudio compile process is looking for, so 
# let's symlink it to the proper name

ln -s

# Make a working directory

mkdir /opt/tmp/
cd /opt/tmp

# Fetch PyAudio source

git clone git://

# Fetch portaudio.h (required for the build)

cd /opt/tmp/pyaudio/src

# build away!

cd /opt/tmp/pyaudio
python build
python install

# done