【发布时间】:2021-04-17 15:22:16
【问题描述】:
我试图导入 PyAudio,但它一直给我一个错误。如果这是我的计算机的问题,我使用的是 Windows 64x 和 Python 3.9.4。这是错误:
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alext\\Desktop\\Olive\\venv\\src\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\alext\\Desktop\\Olive\\venv\\src\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: C:\Users\alext\Desktop\Olive\venv\src\pyaudio\
Complete output (13 lines):
running develop
running egg_info
creating src\PyAudio.egg-info
writing src\PyAudio.egg-info\PKG-INFO
writing dependency_links to src\PyAudio.egg-info\dependency_links.txt
writing top-level names to src\PyAudio.egg-info\top_level.txt
writing manifest file 'src\PyAudio.egg-info\SOURCES.txt'
reading manifest file 'src\PyAudio.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src\PyAudio.egg-info\SOURCES.txt'
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alext\\Desktop\\Olive\\venv\\src\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\alext\\Desktop\\Olive\\venv\\src\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
如果有人知道如何解决此问题,请告诉我!我还在学习如何阅读 Python 日志/错误!谢谢!
【问题讨论】:
-
你可以根据你的python和windows版本下载wheel文件lfd.uci.edu/~gohlke/pythonlibs/#pyaudio这里!并使用 pip 安装它
-
你可以参考这个,差不多,除了,是numpy,你的是PyAudio stackoverflow.com/questions/64294432/…
标签: python