MRSHAO_IS_VERYNB
邵培俊
采纳率0%
2019-02-24 23:42

新手提问:portaudio实在装不来啊,(为了要装PYaudio)

5

C++小白,不是很会,未能成功安装,求大神指导:
电脑属性如下图图片说明
在网上找了一篇安装教程文章,链接如下:
https://www.cnblogs.com/gaoyaguo/p/5011097.html
看完后云里雾里。我就跟着直觉去安装了。安装流程如下:
1、安装DirectX SDK
DirectX SDK
http://www.microsoft.com/en-us/download/details.aspx?id=6812
是个应用程序,我就直接安装了。
2、下载了PortAudio,并随便解压到了D盘下。
http://portaudio.com/docs/v19-doxydocs/compile_windows.html
我下载的版本为pa_stable_v190600_20161030
3、下载ASIO SDK2.3.2 ,并按教程复制到了刚下载的PortAudio的D:\portaudio\src\hostapi\asio文件夹下并改名为ASIOSDK
4、我双击打开了portaudio\build\msvc\portaudio.sln,VS2015启动
图片说明
5、按照之前教程,我右键了这里,点击属性。
C/C++—〉代码生成—〉运行时库/MT
C/C++—〉代码生成—〉浮点模型=快速
C/C++—〉优化—〉省略框架指针= YES

之后一步原文是“为了抑制的PortAudio运行调试控制台输出项目—〉属性—〉配置属性—〉C/C++—〉预处理器。在该领域的预处理器定义,找到PA_ENABLE_DEBUG_OUTPUT并删除它。控制台将不输出调试信息“
但是我打开了预处理器,里面并没有这些东西,只写着<不同选项>的。所以我直接复制了教程里的这个代码
PA_USE_ASIO
PA_USE_DS (DirectSound)
PA_USE_WMME (MME)
PA_USE_WASAPI
PA_USE_WDMKS
PA_USE_SKELETON
在这个空白的栏里,见下图
图片说明
图片说明
图片说明
之后我就直接生成解决方案了,最后用PIP3安装PYAUDIO时果然还是一样不行。 请大神前辈们教我一下,怎么整。我是自己在自学,问的问题尴尬了点,请前辈们包涵,感谢。

最后附上我安装PYAUDIO时的错误,方便的话帮我看看装不了PYaudio是不是因为没有装PORTAUDIO的问题,跪谢!

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>pip3 install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196c
e156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command c:\users\administrator\appdata\local\programs\p
ython\python38\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users
\ADMINI~1\AppData\Local\Temp\pip-install-8s3mtmuj\pyaudio\setup.py';f=get
attr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.clo
se();exec(compile(code, file, 'exec'))" install --record C:\Users\ADMINI~1\A
ppData\Local\Temp\pip-record-i5bb3diy\install-record.txt --single-version-extern
ally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying src\pyaudio.py -> build\lib.win-amd64-3.8
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe
/c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:\users\administrator\appdat
a\local\programs\python\python38\include -Ic:\users\administrator\appdata\local\
programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Stud
io 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\AT
LMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucr
t" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Progr
am Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windo
ws Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\win
rt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.8\Release\src/_portaudio
module.obj
_portaudiomodule.c
c:\users\administrator\appdata\local\programs\python\python38\include\pyconf
ig.h(117): warning C4005: “MS_WIN64”: 宏重定义
c:\users\administrator\appdata\local\programs\python\python38\include\pyconf
ig.h(117): note: 命令行参数: 参见前面的“MS_WIN64”定义
src/_portaudiomodule.c(29): fatal error C1083: 无法打开包括文件: “portaudio
.h”: No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\B
IN\x86_amd64\cl.exe' failed with exit status 2

----------------------------------------

Command "c:\users\administrator\appdata\local\programs\python\python38\python.ex
e -u -c "import setuptools, tokenize;__file__='C:\Users\ADMINI~1\AppData\Loc
al\Temp\pip-install-8s3mtmuj\pyaudio\setup.py';f=getattr(tokenize, 'open', o
pen)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,
file, 'exec'))" install --record C:\Users\ADMINI~1\AppData\Local\Temp\pip-re
cord-i5bb3diy\install-record.txt --single-version-externally-managed --compile"
failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-8s3
mtmuj\pyaudio\

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

相关推荐