python - 如何修复 PyAudio、PortAudio 的安装问题:“致命错误 C1083:无法打开包含文件:'portaudio.h':没有这样的文件或目录”
问题描述
我在安装 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
推荐阅读
- c# - EF Core 内存数据库无法处理 .Count 相关表
- django - 如何在本地运行 Django 作为 Windows 可执行应用程序
- high-availability - ActiveMQ Artemis HA 和用户/角色 - 我应该在每个节点上分别创建用户/角色吗?
- java - 如何在 Sprint Boot Tests 之间重用配置类?
- apache-kafka - 雪花连接器“无法连接到雪花”
- json - JOLT 从 LHS 移动到 RHS 并变平
- c - 如果我知道地址(函数的十六进制值),那么我可以将它分配给函数指针/或具有相同签名的某个变量,如果是,那么如何
- arrays - 如何将 Delphi 中的文件读入字节数组?
- c++ - 扩展类及其数据成员
- mysql - AWS RDS 上的 MySQL init_file