我无法使用 pip 安装程序在 Windows 7 中安装 Python 3.7 的任何模块

我无法使用 pip 安装程序在 Windows 7 中安装 Python 3.7 的任何模块

使用 pip:

C:\Users\DELL\AppData\Local\Programs\Python\Python37-32\Scripts>pip install pyaudio

输出:

Collecting pyaudio
  Using cached PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
  Running setup.py bdist_wheel for pyaudio ... error
  Complete output from command c:\users\dell\appdata\local\programs\python\pytho
n37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\DELL\\
AppData\\Local\\Temp\\pip-build-2wt7vi91\\pyaudio\\setup.py';f=getattr(tokenize,
 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(comp
ile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\DELL\AppData\Local\Temp\tm
pos8y8pmgpip-wheel- --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.7
  copying src\pyaudio.py -> build\lib.win32-3.7
  running build_ext
  building '_portaudio' extension
  creating build\temp.win32-3.7
  creating build\temp.win32-3.7\Release
  creating build\temp.win32-3.7\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /
Ox /W3 /GL /DNDEBUG /MD -Ic:\users\dell\appdata\local\programs\python\python37-3
2\include -Ic:\users\dell\appdata\local\programs\python\python37-32\include "-IC
:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Fil
es (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Wi
ndows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\includ
e\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc/_portaudi
omodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
  _portaudiomodule.c
  src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'port
audio.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN
\\cl.exe' failed with exit status 2

  Failed building wheel for pyaudio
  Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
Complete output from command c:\users\dell\appdata\local\programs\python\pyt
hon37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\DELL
\\AppData\\Local\\Temp\\pip-build-2wt7vi91\\pyaudio\\setup.py';f=getattr(tokeniz
e, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(co
mpile(code, __file__, 'exec'))" install --record C:\Users\DELL\AppData\Local\Tem
p\pip-04qjfess-record\install-record.txt --single-version-externally-managed --c
ompile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo
 /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\dell\appdata\local\programs\python\python37
-32\include -Ic:\users\dell\appdata\local\programs\python\python37-32\include "-
IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program F
iles (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\
Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\incl
ude\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc/_portau
diomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'po
rtaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\B
IN\\cl.exe' failed with exit status 2

答案1

我不确定这是否是您要找的答案,但如果您希望使用 pip 和当前可用的轮子,我的建议是返回到 Python 3.6.x。

截至 2018 年 2 月,Python 3.7 是一个 Beta 预览版,而不是完整版本。这意味着 A) 会有错误、技术/实施问题和其他限制,以及 B) 第三方项目,如pyaudio可能尚未生产与 Python 3.7 兼容的轮子:

pyaudio_wheels

相关内容