简体   繁体   English

我如何在 Windows 10 上为 python 3.8.5 安装 pyaudio

[英]how do i install pyaudio on windows ten for python 3.8.5

I downloaded py audio on windows ten but when i run the code it says please build and install the PortAudio Python bindings first.我在 Windows 10 上下载了 py 音频,但是当我运行代码时,它说请先构建并安装 PortAudio Python 绑定。 When i did pip install portAudio or pip install port audio it said:当我执行 pip install portAudio 或 pip install port audio 时,它说:

    ERROR: Command errored out with exit status 1:
     command: 'c:\users\stewa\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\stewa\\AppData\\Local\\Temp\\pip-install-0ync7n97\\audio.coders\\setup.py'"'"'; __file__='"'"'C:\\Users\\stewa\\AppData\\Local\\Temp\\pip-install-0ync7n97\\audio.coders\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\stewa\AppData\Local\Temp\pip-pip-egg-info-cg067rmb'
         cwd: C:\Users\stewa\AppData\Local\Temp\pip-install-0ync7n97\audio.coders\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\stewa\AppData\Local\Temp\pip-install-0ync7n97\audio.coders\setup.py", line 5, in <module>
        import ConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full 
command 
output.

Does anyone know what i should do?有谁知道我应该怎么做? many thanks非常感谢

According to the documentation, the python wheels only provide support up to version 3.6 of python.根据文档,python 轮子仅提供最高 3.6 版的 python 支持。 Apparently you're using the latest version, I've tested it on my system (Win10) using python 3.6 using this command:显然您使用的是最新版本,我已经使用 python 3.6 在我的系统(Win10)上使用以下命令对其进行了测试:

python -m pip install pyaudio

And it works它有效

Learn more about it here在此处了解更多信息

That probably happened because you got the wrong PyAudio version.这可能是因为你得到了错误的 PyAudio 版本。 You have to get the compatible version with your windows(32 or 64) and with python.您必须获得与您的 windows(32 或 64)和 python 兼容的版本。 check here在这里检查

First you have to uninstall PyAudio first using the command pip uninstall pyAudio首先,您必须先使用命令pip uninstall pyAudio

Then after you getting the right version you got to the repository and install it.然后,在您获得正确的版本后,您将进入存储库并安装它。

Example: pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl示例: pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl

These steps solved the issue for me这些步骤为我解决了这个问题

For Windows OS run:对于 Windows 操作系统运行:

pip install pipwin
pipwin install pyaudio

For Linux OS run:对于 Linux 操作系统运行:

sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
pip install pyaudio --user

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 windows 上的 VScode 3.8.5 中安装 pyaudio - Unable to install pyaudio in VScode 3.8.5 on windows 如何在 Python 3.7 上安装 PyAudio? - How do I install PyAudio on Python 3.7? 如何使用 Python 3.8.5 安装 vtkplotter? - How to install vtkplotter with Python 3.8.5? 无法从终端 window 运行 Python 程序,我该如何解决? (Windows 10、Python 版本 3.8.5) - Can't run Python programs from the terminal window, how do I fix this? (Windows 10, Python version 3.8.5) 我正在使用 python 3.9,但我不知道如何在我的 Windows 10 中安装 pyaudio - I am using python 3.9 and I can't figure out how to install pyaudio in my Windows 10 如何在 python 3.11.1 中安装 Pyaudio? - How to install Pyaudio in python 3.11.1? 如何在Mac OS X 10.7上的virtualenv中安装PyAudio - How do I install PyAudio in virtualenv on Mac OS X 10.7 Python 3.8.5 安装在 MacOS 上,但 python --version 返回 2.7.16 -- 我该如何解决这个问题? - Python 3.8.5 installed on MacOS but python --version returns 2.7.16 -- How do I fix this? 如何在 Windows 上安装 Python 包? - How do I install Python packages on Windows? 当安装程序不起作用时,如何正确卸载/修复 python 3.8.5? - How do I properly uninstall/fix python 3.8.5 when the installer doesn't work?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM