相关疑难解决方法(0)

无法安装pyaudio,gcc错误

尝试按照这里的说明安装pyaudio :

$ git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
$ cd pyaudio
$ sudo python setup.py install
running install
running build
running build_py
running build_ext
building '_portaudio' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from src/_portaudiomodule.c:28:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: command 'gcc' …
Run Code Online (Sandbox Code Playgroud)

python pyaudio

17
推荐指数
6
解决办法
3万
查看次数

无法在 M1 Mac 上安装 PyAudio [PortAudio 已安装]

我访问了很多论坛,尝试了不同的方法,如brew、pip、port 等等,但仍然面临同样的错误。

查看此图片了解更多详情

src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
    #include "portaudio.h"
             ^~~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/gcc' failed with exit code 1
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙吗?

homebrew pip portaudio pyaudio macos-big-sur

8
推荐指数
3
解决办法
2万
查看次数

portaudio.h:没有这样的文件或目录

尝试在ubuntu 16.04中使用pip3安装pyaudio时遇到以下错误:

Collecting pyaudio
  Downloading PyAudio-0.2.11.tar.gz
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-mxgvewdb/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-v55chjee-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    copying src/pyaudio.py -> build/lib.linux-x86_64-3.5
    running build_ext
    building '_portaudio' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -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-x86_64-3.5/src/_portaudiomodule.o …
Run Code Online (Sandbox Code Playgroud)

python speech-recognition google-speech-api

5
推荐指数
3
解决办法
5804
查看次数

Pyaudio 在 Ubuntu 上安装失败

Pyaudio 在 Ubuntu 上安装失败我有 ubuntu 18LTS python 2 和 python 3 pip 10

我根据在谷歌上找到的建议安装了 libportaudio2 和 libasound-dev。是不是因为我还需要安装其他库?

这是我尝试使用 sudo -H 标志但没有区别的错误。

sudo python -m pip install pyaudio
The directory '/home/ec2/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ec2/.cache/pip' or its parent directory is not owned by the current …
Run Code Online (Sandbox Code Playgroud)

python pyaudio

3
推荐指数
2
解决办法
5341
查看次数

通过在我的 Raspberry pi 3 (noobs) 上安装 PyAudio (Python3) 我收到一个错误,我该如何解决这个问题?

pip install pyaudio

Downloading/unpacking pyaudio

  Downloading PyAudio-0.2.11.tar.gz

  Running setup.py (path:/tmp/pip-build-u0HEK5/pyaudio/setup.py) egg_info for package pyaudio

Installing collected packages: pyaudio

  Running setup.py install for pyaudio

building '_portaudio' extension

arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -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

Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-u0HEK5/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), …
Run Code Online (Sandbox Code Playgroud)

pyaudio python-3.x raspberry-pi3

2
推荐指数
1
解决办法
4943
查看次数