当我写pip时安装pyaudio或-m pip时安装PyAudio然后,它显示一个错误,例如下面的-
错误:命令错误,退出状态为1:命令:'C:\ python37 \ python.exe'-u -c'import sys,setuptools,tokenize; sys.argv [0] ='“'”'C:\ Users \ SUDHAN〜1 \ AppData \ Local \ Temp \ pip-install-zern0h1s \ PyAudio \ setup.py'“”';; 文件 ='“'”'C:\ Users \ SUDHAN〜1 \ AppData \ Local \ Temp \ pip-install-zern0h1s \ PyAudio \ setup.py'“'''; f = getattr(tokenize,'”'“'open'”'“',打开)(文件); code = f.read()。replace('“'”'\ r \ n'“'”','“'”'\ n'“'”')); f。 close();例如ec(compile(code,file,'“'”'exec'“'”')))'安装-记录'C:\ Users \ SUDHAN〜1 \ AppData \ Local \ Temp \ pip-record- b0h1w_j0 \ install-record.txt'-单一版本-外部管理-编译--install-headers'C:\ python37 \ Include \ PyAudio'CWD:C:\ Users \ SUDHAN〜1 \ AppData \ Local \ Temp \ pip-install-zern0h1s \ PyAudio \完整的输出(9行):运行安装运行构建运行build_py创建版本创建build \ lib.win-amd64-3.7复制src \ pyaudio.py-> build \ lib.win-amd64-3.7运行build_ext建立'_portaudio'扩展名错误:需要Microsoft Visual C ++ 14.0。使用“ Microsoft Visual C ++生成工具”获取它:http://landinghub.visualstudio.com/visual-cpp-build-tools----------------------------------------错误:命令错误,退出状态为1:'C:\ python37 \ python.exe'-u -c'import sys,setuptools,tokenize; sys.argv [0] ='“'”'C:\ Users \ SUDHAN〜1 \ AppData \ Local \ Temp \ pip-install-zern0h1s \ PyAudio \ setup.py'“'”'; 文件 ='“'”'C:\ Users \ SUDHAN〜1 \ AppData \ Local \ Temp \ pip-install-zern0h1s \ PyAudio \ setup.py'“'”'; f = getattr(tokenize,' “'”“ open'”'“',打开)(文件); code = f.read()。replace('”'“'\ r \ n'“”“','”'“'\ n'”'“'); f.close(); exec(compile(code,file,'”'“'exec'”'“')) )'install --record'C:\ Users \ SUDHAN〜1 \ AppData \ Local \ Temp \ pip-record-b0h1w_j0 \ install-record.txt'--single-version-externally-managed --compile --install-headers'C:\ python37 \ Include \ PyAudio'检查日志以获取完整的命令输出。
需要Microsoft Visual C ++ 14.0。使用“ Microsoft Visual C ++生成工具”获取它>
您需要安装MS VS here