当前位置: 首页 > 知识库问答 >
问题:

错误:命令出错,退出状态为1:Python 3.8

南宫俊逸
2023-03-14

我是在尝试

pip install pyaudio

但是我有一个错误

Collecting pyaudio

使用缓存的PyAudio-0.2.11.tar.gz(37 kB)安装收集的软件包:pyaudio运行setup.py为pyaudio安装:开始运行setup.py为pyaudio安装:完成,状态为“错误”

ERROR: Command errored out with exit status 1:
 command: 'C:\Users\Admin\PycharmProjects\AI\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pycharm-packaging\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pycharm-packaging\\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\Admin\AppData\Local\Temp\pip-record-9rgu21ro\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Admin\PycharmProjects\AI\venv\include\site\python3.8\pyaudio'
     cwd: C:\Users\Admin\AppData\Local\Temp\pycharm-packaging\pyaudio\
Complete output (17 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
warning: build_py: byte-compiling is disabled, skipping.

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
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Admin\PycharmProjects\AI\venv\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------

错误:命令出错,退出状态为1:' C:\ Users \ Admin \ PycharmProjects \ AI \ venv \ Scripts \ python . exe '-u-C ' import sys,setuptools,tokenize。sys . argv[0]= ' " ' " ' C:\ Users \ Admin \ AppData \ Local \ Temp \ py charm-packaging \ py audio \ setup . py ' " ' ";file = ' " ' " ' C:\ Users \ Admin \ AppData \ Local \ Temp \ py charm-packaging \ py audio \ setup . py ' " ' ";f=getattr(tokenize,' " ' " ' open ' " ' " ',open)(file);code=f.read()。替换(“”“”“\ r \ n”“”“”“”“”“\ n”“”);f . close();exec(compile(code,file,' " ' " ' " ' exec ' " ' " ' " ' " ')' install-record ' C:\ Users \ Admin \ AppData \ Local \ Temp \ pip-record-9 rgu 21 ro \ install-record . txt '-single-version-externally-managed-compile-install-headers ' C:\ Users \ Admin \ pycharm projects \ AI \ venv \ include \ site \ python 3.8 \ py audio '检查日志中完整的命令输出。

共有1个答案

拓拔浩阔
2023-03-14

你必须使用python版本2.7,3.4,3.6否则会出现错误。

我下载了这个版本的python的“https://www.python.org/downloads/release/python-2717/”,它能够安装pyaudio。

已安装皮奥迪奥

如果您有多个版本的Python,那么例如要运行Python 2.7.17的pip,请使用以下命令:py -2 -m pip安装pyaudio模块pyaudio

 类似资料: