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 pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org
Collecting pyaudio
  Downloading https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
**Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1x_v639r/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\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 pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org
Collecting Pygame
  Downloading https://files.pythonhosted.org/packages/b2/6b/c510f0853765eb2219ca5aa3d416d65bb0dea7cd9bb2984aea0a0e04c24d/pygame-1.9.4.tar.gz (4.8MB)
    100% |████████████████████████████████| 4.8MB 1.2MB/s 
**Command "python setup.py 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?

Thanks!!

Thanaraj.

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 libportaudio.so.2.0.0 libportaudio.so


# Make a working directory

mkdir /opt/tmp/
cd /opt/tmp


# Fetch PyAudio source

git clone git://github.com/jleb/pyaudio.git


# Fetch portaudio.h (required for the build)

cd /opt/tmp/pyaudio/src
wget https://raw.githubusercontent.com/EddieRingle/portaudio/master/include/portaudio.h


# build away!

cd /opt/tmp/pyaudio
python setup.py build
python setup.py install

# done