MagicMirror² v2.8.0 is available! For more information about this release, check out this topic.

Having trouble with pyaudio for MMM-awesome-alexa



  • i was able to do the setup for the line of

    sudo apt-get install swig3.0 python-pyaudio python3-pyaudio sox
    

    but when i tried to do

    pip install pyaudio
    

    i got a large error message saying:

    pi@raspberrypi:~ $ pip install pyaudio
    Collecting pyaudio
      Downloading https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
    Building wheels for collected packages: pyaudio
      Running setup.py bdist_wheel for pyaudio ... error
      Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-iJzkjw/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpTyBzJLpip-wheel- --python-tag cp27:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-2.7
      copying src/pyaudio.py -> build/lib.linux-armv7l-2.7
      running build_ext
      building '_portaudio' extension
      creating build/temp.linux-armv7l-2.7
      creating build/temp.linux-armv7l-2.7/src
      arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-armv7l-2.7/src/_portaudiomodule.o
      src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
       #include "portaudio.h"
                             ^
      compilation terminated.
      error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
      
      ----------------------------------------
      Failed building wheel for pyaudio
      Running setup.py clean for pyaudio
    Failed to build pyaudio
    Installing collected packages: pyaudio
      Running setup.py install for pyaudio ... error
        Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-iJzkjw/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-UfXgaL-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
        running install
        running build
        running build_py
        creating build
        creating build/lib.linux-armv7l-2.7
        copying src/pyaudio.py -> build/lib.linux-armv7l-2.7
        running build_ext
        building '_portaudio' extension
        creating build/temp.linux-armv7l-2.7
        creating build/temp.linux-armv7l-2.7/src
        arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-armv7l-2.7/src/_portaudiomodule.o
        src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
         #include "portaudio.h"
                               ^
        compilation terminated.
        error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
        
        ----------------------------------------
    Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-iJzkjw/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-UfXgaL-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-iJzkjw/pyaudio/
    

    how do i fix this?



  • nevermind figured it out but idk how to mark as solved, had to get python dev stuff, heres a link if anyone else has issues:
    SOLUTION