英文:
pip install PyAudio: error: command 'cl.exe' failed: No such file or directory
问题
抱歉,我只会翻译文本内容,不会执行代码。以下是您提供的文本的翻译:
我正在尝试在Windows 10上安装PyAudio,但我遇到了以下错误。首先,它要求安装Microsoft Visual C++ Build Tools,所以我成功安装了它。但现在它显示以下错误。谢谢。
错误:命令以退出状态1结束:
命令:'c:\users\nadeem\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = 'C:\Users\NADEEM\AppData\Local\Temp\pip-install-g79_tntp\PyAudio\setup.py'; file='C:\Users\NADEEM\AppData\Local\Temp\pip-install-g79_tntp\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\NADEEM\AppData\Local\Temp\pip-record-_8egf72w\install-record.txt' --single-version-externally-managed --compile
工作目录:C:\Users\NADEEM\AppData\Local\Temp\pip-install-g79_tntp\PyAudio
完整输出(13行):
正在安装
正在构建
正在构建Py
创建构建
创建build\lib.win32-3.8
复制src\pyaudio.py -> build\lib.win32-3.8
正在构建扩展
正在构建'_portaudio'扩展
创建build\temp.win32-3.8
创建build\temp.win32-3.8\Release
创建build\temp.win32-3.8\Release\src
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\nadeem\appdata\local\programs\python\python38-32\include -Ic:\users\nadeem\appdata\local\programs\python\python38-32\include /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\Release\src/_portaudiomodule.obj
错误:命令'cl.exe'失败:找不到文件或目录
错误:命令以退出状态1结束:'c:\users\nadeem\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = 'C:\Users\NADEEM\AppData\Local\Temp\pip-install-g79_tntp\PyAudio\setup.py'; file='C:\Users\NADEEM\AppData\Local\Temp\pip-install-g79_tntp\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\NADEEM\AppData\Local\Temp\pip-record-_8egf72w\install-record.txt' --single-version-externally-managed --compile 请检查完整的命令输出日志。
英文:
I am trying to install PyAudio on windows 10 but i am getting the following error. first it has given the error to install Microsoft Visual C++ Build Tools so i installed successfully. But now it showing following. Thanks
ERROR: Command errored out with exit status 1:
command: 'c:\users\nadeem\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\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\NADEEM\AppData\Local\Temp\pip-record-_8egf72w\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\NADEEM\AppData\Local\Temp\pip-install-g79_tntp\PyAudio\
Complete output (13 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying src\pyaudio.py -> build\lib.win32-3.8
running build_ext
building '_portaudio' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\src
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\nadeem\appdata\local\programs\python\python38-32\include -Ic:\users\nadeem\appdata\local\programs\python\python38-32\include /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\Release\src/_portaudiomodule.obj
error: command 'cl.exe' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\nadeem\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\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\NADEEM\AppData\Local\Temp\pip-record-_8egf72w\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
答案1
得分: 2
The pip install is trying to download and compile the library. Getting the Windows compilers are easier now, but can be a pain. https://wiki.python.org/moin/WindowsCompilers
多年前,当获取编译器真的很痛苦时,Christoph Gohlke编译并分发了Windows的库。
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
下载与您的Python版本匹配的 .whl 文件,然后告诉pip安装该文件。
pip install ~/Downloads/PyAudio‑0.2.11‑cp36‑cp36m‑win_amd64.whl
英文:
The pip install is trying to download and compile the library. Getting the Windows compilers are easier now, but can be a pain. https://wiki.python.org/moin/WindowsCompilers
Years ago when the compilers were a true pain to get Christoph Gohlke compiled and distributed the libraries for windows.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Download the .whl file for your python version and tell pip to install that file.
pip install ~/Downloads/PyAudio‑0.2.11‑cp36‑cp36m‑win_amd64.whl
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论