安装pyaudio(Linux)

12 篇文章 0 订阅

报错信息如下:

(audio2face) dreamdeck@jj:~/Documents/MJJ/code/Face/FACEGOOD-Audio2Face$ pip install pyaudio
Collecting pyaudio
  Using cached PyAudio-0.2.12.tar.gz (42 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
  ╰─> [16 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-37
      copying src/pyaudio.py -> build/lib.linux-x86_64-cpython-37
      running build_ext
      building '_portaudio' extension
      creating build/temp.linux-x86_64-cpython-37
      creating build/temp.linux-x86_64-cpython-37/src
      gcc -pthread -B /home/dreamdeck/anaconda3/envs/audio2face/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/home/dreamdeck/anaconda3/envs/audio2face/include/python3.7m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-cpython-37/src/_portaudiomodule.o
      src/_portaudiomodule.c:31:10: fatal error: portaudio.h: No such file or directory
       #include "portaudio.h"
                ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/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: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects

解决办法

sudo apt-get install portaudio19-dev
sudo apt-get install python3-all-dev
pip install pyaudio
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值