gpt4 book ai didi

python - 无法使用pip安装pyaudio

转载 作者:行者123 更新时间:2023-12-01 00:35:04 27 4
gpt4 key购买 nike

我尝试使用 pip 安装 pyaudio,但出现错误。

    C:\Users\divya>pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command "c:\program files (x86)\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\divya\\AppData\\Local\\Temp\\pip-install-5eoc_ykq\\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 C:\Users\divya\AppData\Local\Temp\pip-record-xhzsi_4l\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.22.27905\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-Ic:\program files (x86)\python37-32\include" "-Ic:\program files (x86)\python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

----------------------------------------
Command ""c:\program files (x86)\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\divya\\AppData\\Local\\Temp\\pip-install-5eoc_ykq\\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 C:\Users\divya\AppData\Local\Temp\pip-record-xhzsi_4l\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\divya\AppData\Local\Temp\pip-install-5eoc_ykq\pyaudio\

请查看此错误并帮助我解决我在安装 pyGTK 时也遇到类似的错误。我也尝试升级 pip,但没有任何效果。

最佳答案

Windows 上没有针对 Python 3.7 的预构建包(您可能有 32 位版本),因此您需要在 PC 上准备构建环境才能使用此包。找到 3.7 的轮子会更容易,因为某些软件包很难在 Windows 上构建。

您可以找到您的方向盘here

检查您的 python 版本并下载正确的轮子

之后您可以键入进行安装:

pip install <yourwheel.whl>

关于python - 无法使用pip安装pyaudio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57858409/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com