如何修复 PyAudio、PortAudio 的安装问题:“致命错误 C1083:无法打开包含文件:'portaudio.h':没有这样的文件或目录”

2024-01-03

我在安装 PyAudio 和 portaudio 时遇到问题。

当我做python -m pip install pyaudio我收到此错误:

    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\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
Command ""C:\Users\This PC\AppData\Local\Programs\Python\Python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\THISPC~1\\AppData\\Local\\Temp\\pip-install-3ock7jqh\\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\THISPC~1\AppData\Local\Temp\pip-record-14pe9p6y\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\THISPC~1\AppData\Local\Temp\pip-install-3ock7jqh\pyaudio\

因此,在查看该错误后,我读到我需要安装 portaudio。所以我做了python -m pip install portaudio并得到这个错误:

Collecting portaudio
Could not find a version that satisfies the requirement portaudio (from versions: )
No matching distribution found for portaudio

我现在不知道该去哪里。


尝试一下,以管理员身份运行 CMD 并运行以下命令:

pip install pipwin
pipwin install pyaudio
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何修复 PyAudio、PortAudio 的安装问题:“致命错误 C1083:无法打开包含文件:'portaudio.h':没有这样的文件或目录” 的相关文章

随机推荐