ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

python – pyAudio无法安装:Windows 10

2019-09-29 21:59:21  阅读:429  来源: 互联网

标签:python pip pyaudio


当我尝试使用pip install pyaudio安装pyAudio时,我收到错误.它看起来像这样:

C:\Users\pankajkaun>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:\users\pankajkaun\desktop\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\PANKAJ~1\\AppData\\Local\\Temp\\pip-install-pw8_ueh5\\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\PANKAJ~1\AppData\Local\Temp
\pip-record-eru_9orv\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    copying src\pyaudio.py -> build\lib.win-amd64-3.7
    running build_ext
    building '_portaudio' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:\users\pankajkaun\desktop\python\include -Ic:\users\pankajkaun\desktop\python\
include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-
IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:
\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.7\Release\src/_portaudiomodule.obj
    _portaudiomodule.c
    c:\users\pankajkaun\desktop\python\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
    src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
    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\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\pankajkaun\desktop\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\PANKAJ~1\\AppData\\Local\\Temp\\pip-install-pw8_ueh5\\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\PANKAJ~1\AppData\Local\Temp\pip-record-eru_9orv\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\PANKAJ~1\AppData\Local\Temp\pip-install-pw8_ueh5\pyaudio\

知道这里发生了什么吗?

解决方法:

根据official docs of pyaudio

Microsoft Windows

Install using pip:

python -m pip install pyaudio

Notes: pip will fetch and install PyAudio wheels (prepackaged binaries). Currently, there are wheels compatible with the official distributions of Python 2.7, 3.4, 3.5, and 3.6. For those versions, both 32-bit and 64-bit wheels are available.

您尝试为3.7安装pyaudio,因此它尝试编译它.
Gohlke – Unofficial Windows Binaries for Python Extension Packages下载并安装车轮.可提供32和64位python 3.7车轮.

标签:python,pip,pyaudio
来源: https://codeday.me/bug/20190929/1833279.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有