树莓派上安装wukong-robot报错

· 2019-02-26
点点滴滴 程序设计

在 树莓派 上安装好 Raspbian 系统之后,开始安装 wukong-robot :

具体安装步骤参见教程:https://wukong.hahack.com/#/install

到这一步报错:
pi@Sirit:~/wukong-robot $ pip3 install pyaudio
报错信息:

pi@Sirit:~/wukong-robot $ pip3 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/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vlgzc01f/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/tmpz5ycoi5jpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.5
  copying src/pyaudio.py -> build/lib.linux-armv7l-3.5
  running build_ext
  building '_portaudio' extension
  creating build/temp.linux-armv7l-3.5
  creating build/temp.linux-armv7l-3.5/src
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-armv7l-3.5/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/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vlgzc01f/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-0d7820uk-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-3.5
    copying src/pyaudio.py -> build/lib.linux-armv7l-3.5
    running build_ext
    building '_portaudio' extension
    creating build/temp.linux-armv7l-3.5
    creating build/temp.linux-armv7l-3.5/src
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-armv7l-3.5/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/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vlgzc01f/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-0d7820uk-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-vlgzc01f/pyaudio/
pi@Sirit:~/wukong-robot $

运行命令:
pi@Sirit:~ $ sudo apt-get install portaudio19-dev python-all-dev

然后再次安装 pyaudio 成功:
pi@Sirit:~ $ pip3 install pyaudio

Collecting pyaudio
  Using cached 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 ... done
  Stored in directory: /home/pi/.cache/pip/wheels/f4/a8/a4/292214166c2917890f85b2f72a8e5f13e1ffa527c4200dcede
Successfully built pyaudio
Installing collected packages: pyaudio
Successfully installed pyaudio-0.2.11
pi@Sirit:~ $ 

  • 本文作者:恩爸
  • 本文链接:http://www.sirit.com.cn/archives/311/
  • 版权许可:知识共享署名-相同方式共享4.0国际许可协议
  • 友情提示:本文更新于2022年08月18日,已超过226天没有更新,若内容或图片失效,请留言反馈。
  • ReSpeaker 4-Mic Array 扩展板到手
  • 更新树莓派 firmware(固件)
取消回复

说点什么?

本站已经运行0天 © 2005- 大嘴狗狗. - Typecho & Moricolor - 粤ICP备18101800号 - 粤公网安备44030402005553号