Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

can't install and use pyaudio in python 3.7

C:UsersDellPycharmProjectspythonProject1>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:python37python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Dell\AppData\Local\Temp\pip-install-qm5dhs1u\pyaud
io_0fa5615a0f1d45fe897d47e2b712cf51\setup.py'"'"'; __file__='"'"'C:\Users\Dell\AppData\Local\Temp\pip-install-qm5dhs1u\pyaudio_0fa5615a0f1d45fe897d47e2b712cf
51\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"
'exec'"'"'))' install --record 'C:UsersDellAppDataLocalTemppip-record-mst52wx_install-record.txt' --single-version-externally-managed --compile --install-head
ers 'c:python37Includepyaudio'
         cwd: C:UsersDellAppDataLocalTemppip-install-qm5dhs1upyaudio_0fa5615a0f1d45fe897d47e2b712cf51
    Complete output (9 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.7
    copying srcpyaudio.py -> buildlib.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": http://landinghub.visualstudio.com/visual-cpp-build-tools
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:python37python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Dell\AppData\Local\
Temp\pip-install-qm5dhs1u\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\setup.py'"'"'; __file__='"'"'C:\Users\Dell\AppData\Local\Temp\pip-install-qm5dhs1u\pyaud
io_0fa5615a0f1d45fe897d47e2b712cf51\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:python37python.exe' -u -c 'im
port sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Dell\AppData\Loca
l\Temp\pip-install-qm5dhs1u\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\setup.py
'"'"'; __file__='"'"'C:\Users\Dell\AppData\Local\Temp\pip-install-qm5dhs1u
pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.cl
ose();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersDellAppDataLocalTemppip-record-mst52wx_install-record.txt' --single-version-exte
rnally-managed --compile --install-headers 'c:python37Includepyaudio' Check the logs for full command output.
question from:https://stackoverflow.com/questions/66045420/cant-install-and-use-pyaudio-in-python-3-7

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As the error message says, please install the build tools:

Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...