【问题标题】:I have PyAudio installed on my windows for sure, but when I try to install into Pycharm I get this message?我肯定在我的 Windows 上安装了 PyAudio,但是当我尝试安装到 Pycharm 中时,我收到了这条消息?
【发布时间】:2021-04-19 20:26:29
【问题描述】:

这不是代码 - (我已经阅读了谷歌上的所有内容,我有最新版本的 pip、python、pycharm, 我已经安装了 Microsoft Visual Studios C++,然后 pip install pipwin pipwin install pyaudio - 所有这些都安装得很好,没有错误 - 只是我的 Pycharm 由于某种原因不接受该软件包。有什么想法吗?

这是 Pycharm 'Available Packages' 中的错误消息

 Collecting PyAudio
  Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: PyAudio
  Building wheel for PyAudio (setup.py): started
  Building wheel for PyAudio (setup.py): finished with status 'error'
  Running setup.py clean for PyAudio
Failed to build PyAudio
Installing collected packages: PyAudio
    Running setup.py install for PyAudio: started
    Running setup.py install for PyAudio: finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\joe_h\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\joe_h\\AppData\\Local\\Temp\\pip-install-j2z8zhnm\\pyaudio_4cd919902d73421787fec2034b1272c2\\setup.py'"'"'; __file__='"'"'C:\\Users\\joe_h\\AppData\\Local\\Temp\\pip-install-j2z8zhnm\\pyaudio_4cd919902d73421787fec2034b1272c2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\joe_h\AppData\Local\Temp\pip-wheel-7444zi78'
       cwd: C:\Users\joe_h\AppData\Local\Temp\pip-install-j2z8zhnm\pyaudio_4cd919902d73421787fec2034b1272c2\
  Complete output (11 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  copying src\pyaudio.py -> build\lib.win-amd64-3.9
  warning: build_py: byte-compiling is disabled, skipping.
  
  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: Failed building wheel for PyAudio
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\joe_h\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\joe_h\\AppData\\Local\\Temp\\pip-install-j2z8zhnm\\pyaudio_4cd919902d73421787fec2034b1272c2\\setup.py'"'"'; __file__='"'"'C:\\Users\\joe_h\\AppData\\Local\\Temp\\pip-install-j2z8zhnm\\pyaudio_4cd919902d73421787fec2034b1272c2\\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\joe_h\AppData\Local\Temp\pip-record-4nk7pxtt\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\joe_h\AppData\Roaming\Python\Python39\Include\PyAudio'
         cwd: C:\Users\joe_h\AppData\Local\Temp\pip-install-j2z8zhnm\pyaudio_4cd919902d73421787fec2034b1272c2\
    Complete output (11 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    copying src\pyaudio.py -> build\lib.win-amd64-3.9
    warning: build_py: byte-compiling is disabled, skipping.
    
    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:\Users\joe_h\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\joe_h\\AppData\\Local\\Temp\\pip-install-j2z8zhnm\\pyaudio_4cd919902d73421787fec2034b1272c2\\setup.py'"'"'; __file__='"'"'C:\\Users\\joe_h\\AppData\\Local\\Temp\\pip-install-j2z8zhnm\\pyaudio_4cd919902d73421787fec2034b1272c2\\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\joe_h\AppData\Local\Temp\pip-record-4nk7pxtt\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\joe_h\AppData\Roaming\Python\Python39\Include\PyAudio' Check the logs for full command output.

【问题讨论】:

标签: python pycharm package speech-recognition pyaudio


【解决方案1】:

PyAudio 在 Windows 上没有用于 Python 3.7+ 的轮子(预构建包),Python 2.7、3.4、3.5 和 3.6 支持 PyAudio

如果你有 anaconda,你可以运行 conda install pyaudio,这应该可以工作。

【讨论】:

  • 您运行了conda install pyaudio,但没有成功?我用pip 命令对此进行了测试,我收到了同样的错误,一切都用conda install pyaudio 解决了..
  • 日志中清楚地说明了错误,您正在运行 Python 3.9,没有任何适用于 Windows 的 Python 3.7+ 的预构建包,ctrl + alt + s 并将您的 Python 解释器调整为任一版本低于 3.9 或指向您的 Anaconda 库。
猜你喜欢
  • 1970-01-01
  • 2023-03-24
  • 2020-03-16
  • 2022-06-21
  • 2020-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-15
相关资源
最近更新 更多