我第一次尝试:
pip install pyaudio
Run Code Online (Sandbox Code Playgroud)
但有人告诉我
-bash: pip: command not found
Run Code Online (Sandbox Code Playgroud)
然后我尝试了:
pip3 install pyaudio
Run Code Online (Sandbox Code Playgroud)
然后我得到了:
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/77/gz1txkwj2z925vk6jrkx3wp80000gn/T/pip-build-43z_qk7o/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/77/gz1txkwj2z925vk6jrkx3wp80000gn/T/pip-tkf78ih4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/77/gz1txkwj2z925vk6jrkx3wp80000gn/T/pip-build-43z_qk7o/pyaudio
Run Code Online (Sandbox Code Playgroud)
但我安装了portaudio
brew install portaudio
Run Code Online (Sandbox Code Playgroud)
警告:已安装portaudio-19.20140130
那我该怎么办?非常感谢,这是我第一次使用pyaudio,所以.......
:)
我试过了
easy_install pyaudio
Run Code Online (Sandbox Code Playgroud)
它不起作用.我得到以下内容:
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.7
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.7.tar.gz
Processing pyaudio-0.2.7.tar.gz
Writing /var/folders/vg/98k5hfl52m16wm45ckdx1_5c0000gp/T/easy_install-s1wLkT/PyAudio-0.2.7/setup.cfg
Running PyAudio-0.2.7/setup.py -q bdist_egg --dist-dir /var/folders/vg/98k5hfl52m16wm45ckdx1_5c0000gp/T/easy_install-s1wLkT/PyAudio-0.2.7/egg-dist-tmp-pFDrFR
warning: no files found matching '*.c' under directory 'test'
clang: warning: argument unused during compilation: '-mno-fused-madd'
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^
1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
Run Code Online (Sandbox Code Playgroud) 我访问了很多论坛,尝试了不同的方法,如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)
有人可以帮忙吗?
我想在osx lion上安装pyaudio,但我无法做到.每次我尝试使用pkg时,它都不会安装任何东西.当我尝试使用pip安装它时,我有以下错误(在很多其他行中):
lipo: can't open input file: /var/folders/11/gfpzwjdd6dj7hbz7dpbvx9y40000gn/T//ccYnQM1k.out (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
错误:命令'/ usr/bin/llvm-gcc'失败,退出状态为1
如果有人可以帮助我,谢谢.
我一直在尝试为一个项目安装 PyAudio。我正在使用配备 M1 芯片、操作系统 11.0.1 的 Mac。
每次我运行时pip3 install pyaudio都会遇到同样的错误:
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
我已经安装了 portaudiobrew install portaudio并拥有 x-code 命令行工具,但它仍然无法工作。我也尝试过将 sudo 放在它前面,但没有成功。
任何帮助表示赞赏!
这是错误的图像: 错误
每次运行 pip install pyaudio 时都会出现以下错误
\npip3 install pyaudio\nCollecting pyaudio\n Using cached PyAudio-0.2.12.tar.gz (42 kB)\n Installing build dependencies ... done\n Getting requirements to build wheel ... done\n Preparing metadata (pyproject.toml) ... done\nBuilding wheels for collected packages: pyaudio\n Building wheel for pyaudio (pyproject.toml) ... error\n error: subprocess-exited-with-error\n \n \xc3\x97 Building wheel for pyaudio (pyproject.toml) did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [16 lines of output]\n running bdist_wheel\n running build\n running build_py\n creating build\n creating build/lib.macosx-10.9-universal2-cpython-310\n copying src/pyaudio.py -> build/lib.macosx-10.9-universal2-cpython-310\n …Run Code Online (Sandbox Code Playgroud) pyaudio ×6
python ×4
macos ×2
pip ×2
portaudio ×2
homebrew ×1
osx-lion ×1
python-3.4 ×1
virtualenv ×1