pyaudio模块 python_python无法安装pyaudio模块

错误信息

E:\MyCode\数据查看器\DATA_VIEWER>pip install pyaudio

Collecting pyaudio

Using cached PyAudio-0.2.11.tar.gz (37 kB)

Using legacy setup.py install for pyaudio, since package 'wheel' is not installed.

Installing collected packages: pyaudio

Running setup.py install for pyaudio ... error

ERROR: Command errored out with exit status 1:

command: 'c:\users\zhu\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\zhu\\AppDa

ta\\Local\\Temp\\pip-install-g0ipaimi\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\zhu\\AppData\\Local\\Temp\\pip-install-g0ipaimi\\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\zhu\AppData\Local\Temp\pip-record-mullvorl\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\u

sers\zhu\appdata\local\programs\python\python37\Include\pyaudio'

cwd: C:\Users\zhu\AppData\Local\Temp\pip-install-g0ipaimi\pyaudio\

Complete output (9 lines):

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

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

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

ERROR: Command errored out with exit status 1: 'c:\users\zhu\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.arg

v[0] = '"'"'C:\\Users\\zhu\\AppData\\Local\\Temp\\pip-install-g0ipaimi\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\zhu\\AppData\\Local\\Temp\\pip-install-

g0ipaimi\\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\zhu\AppData\Local\Temp\pip-record-mullvorl\install-record.txt' --single-version-externally-managed

--compile --install-headers 'c:\users\zhu\appdata\local\programs\python\python37\Include\pyaudio' Check the logs for full command output.

出现原因

在windows上没有python3.7的预构建包(轮子),有一个用于Python 2.7和3.4到3.6,因此需要在PC上准备构建环境以使用此包。因为有些软件包很难在Windows上构建,所以找到3.7的轮子更容易一些。

解决办法

下载你所需的轮子,根据你的python安装的版本,下载相匹配的轮子。

地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/

在该页面搜索你要的包的名字,然后点进去,选择相应的版本,下载下来,使用pip命令安装。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值